Error log questions

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


On Wed, Sep 05, 2007 at 08:14:31AM +0300, Athan Dimoy wrote:

> "Igor Sysoev" <is at rambler-co.ru> wrote in message 
> news:20070904190445.GT94469 at rambler-co.ru...
> >  server {
> >      error_log   ...
> >      ...
> >  }
> 
> 
> I think my question wasn't clear enough,
> I want to use server_log outside server {} context to save nginx messages 
> only (startup, application errors, warnings etc). The problem is that even 
> when error_log is outside http {...} or server {...}, it still saves all 
> the messages of virtual servers ("No such file or directory" etc).
> 
> What I want to achieve is to mimic the behavour of Apache ErrorLog 
> directive. When I was using Apache, I had this directive in two places, in 
> generic server config to log generic application errors and inside each 
> virtual host to log domain-specific messages.

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;
    }


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





More information about the nginx mailing list