nginx-0.7.21

Igor Sysoev is at rambler-co.ru
Wed Nov 12 10:17:56 MSK 2008


On Tue, Nov 11, 2008 at 02:42:53PM -0800, mike wrote:

> Cool!
> 
> Question -
> 
> Is there any way nginx can support conditional error logging and
> conditional debugging?
> 
> Turning on debugging for an entire server produces way too much
> output. I'd love to be able to turn on debugging anywhere. From server
> {} or location {} or even an if statement. This was one thing that
> lighttpd was great with.
> 
> Same with error logging - there are a couple conditions where I'd like
> to turn error_log off - but error_log is a global setting.
> 
> These two things would make my life a bit easier. Especially the
> debugging one. I have the misfortune of supporting a complex site
> setup with a ton of rewrites and a handful of location blocks and
> such, and it helps to be able to debug which one(s) are being
> triggered, but each HTTP request produces like 50-60 lines of output -
> and one page might trigger 10-20 HTTP requests easily. That's a lot of
> scroll and text to deal with ...

You may set error_log per server or location, but not inside "if".
As to a debugging error_log, I have found that is more convenient
to set it per IP-address:

error_log  /path/to/log  notice;

events {
    debug_connection  192.168.1.0/24;
    debug_connection  192.168.10.1;
}


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list