Error log questions

Igor Sysoev is at rambler-co.ru
Wed Sep 5 09:42:22 MSD 2007


On Wed, Sep 05, 2007 at 08:33:12AM +0300, Athan Dimoy wrote:

> "Igor Sysoev" <is at rambler-co.ru> wrote in message 
> news:20070905052441.GA1738 at rambler-co.ru...
> >Does this work for you:
> >
> >error_log   main_error.log;
> >
> >http {
> >   error_log   http_error.log;
> >
> >   server  {
> >        server_name   one;
> >        error_log     http_one_error.log;
> >   }
> >
> >   server  {
> >        server_name   two;
> >        error_log     http_two_error.log;
> >   }
> >
> >   server  {
> >        server_name   three;
> >        # will log in    http__error.log;
> >   }
> 
> 
> If I understand this right, when an error_log directive is missing from a 
> context, it still logs in the parent one?

Yes, and this is the same as in Apache: ErrorLog is inherited from prevoius
level. nginx allows to set error_log even on location level.

> If that's the case, can I use something like "error_log /dev/null" inside 
> each server context avoiding loging domain-specific errors in master error 
> log?

Yes, but I do not think that not logging errors is good thing.
It's better to set

   server  {
       server_name   three;
       error_log     crit_error.log   crit;

for all such sites.


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





More information about the nginx mailing list