# Error log not reflect the problem related log

**URL:** <https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072>\
**Category:** NGINX\
**Created:** [March 20, 2012, 10:49am UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072 "2012-03-20T10:49:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 20, 2012, 10:49am UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/1 "2012-03-20T10:49:53Z")

</div>

Hi

I have configured the nagios on centos, I have perl related code that  
I have set.

the problem is that when I was configured the same, it had a problem of  
database connection, but in error log it shows the error like 502 bad  
gateway or other error which not reflect the error related to database.  
Means from the error I was not able to conclude that what was the  
problem.

Is there any way to change the error log setting so it reflect the  
exact problem ?

Posted at Nginx Forum:

> **[error log not reflect the problem related log](https://forum.nginx.org/read.php?2,224065,224065#msg-224065)**
>
> Hi I have configured the nagios on centos, I have perl related code that I have set. the problem is that when I was configured the same, it had a problem of database connection, but in error log it shows the error like 502 bad gateway or other error...

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 20, 2012, 11:26am UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/2 "2012-03-20T11:26:03Z")

</div>

Hello!

On Tue, Mar 20, 2012 at 05:49:17AM -0400, niraj wrote:

> Is there any way to change the error log setting so it reflect the  
> exact problem ?

The exact reason is expected to be in your backend’s log. It’s  
your backend which failed to produce response, nginx doesn’t known  
why it failed to do so.

Maxim D.

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 20, 2012, 12:02pm UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/3 "2012-03-20T12:02:10Z")

</div>

Hi

```
 backend's log mean in which file ?

 I was using apache (httpd) also in that access.log and error.log in

```

that if any application having any error then it reflect in error log.  
at the same time that was not happened in Nginx.

can you tell me how can I diagnose my application related error ?

Posted at Nginx Forum:

> **[Re: error log not reflect the problem related log](https://forum.nginx.org/read.php?2,224065,224073#msg-224073)**
>
> Hi I have configured the nagios on centos, I have perl related code that I have set. the problem is that when I was configured the same, it had a problem of database connection, but in error log it shows the error like 502 bad gateway or other error...

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 20, 2012, 1:36pm UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/4 "2012-03-20T13:36:18Z")

</div>

Hello!

On Tue, Mar 20, 2012 at 07:01:53AM -0400, niraj wrote:

> ```
> backend's log mean in which file ?
> 
> ```

This depends on which backend do you use to execute your  
application. E.g. if you use Apache as a backend - it will be  
Apache’s error log.

Maxim D.

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 20, 2012, 2:42pm UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/5 "2012-03-20T14:42:49Z")

</div>

Hello!

On Tue, Mar 20, 2012 at 08:56:44AM -0400, niraj wrote:

> Hi
> 
> ```
> Very True, If application use apache then logs in apache's error
> 
> ```
> 
> log.
> 
> But now I am using Nginx, and its error log not give the details error  
> due to that from error log we are not able to rectified the issue.
> 
> You suggested backend’s log but I dont found any backend’s log which can  
> help to rectified the issue.

By itself nginx doesn’t execute applications. You haven’t  
provided any information about which backend you’ve configured to  
do so, therefore it’s unlikely that anybody will be able to help  
you to find your backend’s logs.

Maxim D.

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 20, 2012, 1:57pm UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/6 "2012-03-20T13:57:28Z")

</div>

Hi

```
Very True, If application use apache then logs in apache's error

```

log.

But now I am using Nginx, and its error log not give the details error  
due to that from error log we are not able to rectified the issue.

You suggested backend’s log but I dont found any backend’s log which can  
help to rectified the issue.

Posted at Nginx Forum:

> **[Re: error log not reflect the problem related log](https://forum.nginx.org/read.php?2,224065,224089#msg-224089)**
>
> Hi I have configured the nagios on centos, I have perl related code that I have set. the problem is that when I was configured the same, it had a problem of database connection, but in error log it shows the error like 502 bad gateway or other error...

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 21, 2012, 5:59pm UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/7 "2012-03-21T17:59:23Z")

</div>

Hello!

On Wed, Mar 21, 2012 at 12:33:34AM -0400, niraj wrote:

> Hi  
> I am using the application which having code in perl. I have both  
> html and cgi files.
> 
> For Cgi and perl files I have install the fcgi and spawn-fcgi and  
> configure the same in Nginx configuration.

What do you mean by “fcgi” here? Perl cgi files aren’t able to  
talk via the FastCGI protocol, you either have to change them to  
use the FastCGI protocol (e.g. by using FCGI perl module), or need  
some wrapper which will do fastcgi to cgi protocol conversion.

(Note well that spawn-fcgi isn’t a fastcgi/cgi wrapper, it’s just a  
simple helper program to start multiple processes of a fastcgi  
application.)

In theory fastcgi allows to pass errors from an application to  
server via special FCGI\_STDERR stream (and nginx will log such  
errors into it’s error log at ‘error’ level with “FastCGI sent in  
stderr” prefix). Though in practice this requires fastcgi  
application to properly redirect errors into the stream in  
question, and this isn’t always done properly.

Maxim D.

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 21, 2012, 5:33am UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/8 "2012-03-21T05:33:58Z")

</div>

Hi  
I am using the application which having code in perl. I have both  
html and cgi files.

For Cgi and perl files I have install the fcgi and spawn-fcgi and  
configure the same in Nginx configuration.

For database I am using Mysql and OS is Cent OS.

Is any other information required ?

Please suggest where would be the exact error log for this application  
which can help to solve the application related error.

Posted at Nginx Forum:

> **[Re: error log not reflect the problem related log](https://forum.nginx.org/read.php?2,224065,224130#msg-224130)**
>
> Hi I have configured the nagios on centos, I have perl related code that I have set. the problem is that when I was configured the same, it had a problem of database connection, but in error log it shows the error like 502 bad gateway or other error...

---

<div class="post-metadata">

**Author:** ![niraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@niraj](https://www.ruby-forum.com/u/niraj)\
**Post date:** [March 21, 2012, 6:03pm UTC](https://www.ruby-forum.com/t/error-log-not-reflect-the-problem-related-log/218072/9 "2012-03-21T18:03:50Z")

</div>

k Thnkx

Posted at Nginx Forum:

> **[Re: error log not reflect the problem related log](https://forum.nginx.org/read.php?2,224065,224156#msg-224156)**
>
> Hi I have configured the nagios on centos, I have perl related code that I have set. the problem is that when I was configured the same, it had a problem of database connection, but in error log it shows the error like 502 bad gateway or other error...
