Welcome! Log In Create A New Profile

Advanced

Log 404 errors only?

Posted by Peter Hinse 
Peter Hinse
Log 404 errors only?
January 20, 2009 03:00PM
Hi all,

is there any way to log only HTTP codes >= 400 (maybe only 404 errors)
in the access.log? I'm not interested in successful delivery, redirects
or similar.

Regards,

Peter
Igor Sysoev
Re: Log 404 errors only?
January 20, 2009 03:10PM
On Tue, Jan 20, 2009 at 02:44:05PM +0100, Peter Hinse wrote:

> is there any way to log only HTTP codes >= 400 (maybe only 404 errors)
> in the access.log? I'm not interested in successful delivery, redirects
> or similar.

location / {
access_log off;
error_page 404 /404;
}

location = /404 {
access_log /path/to/log;
}


--
Igor Sysoev
http://sysoev.ru/en/
Peter Hinse
Re: Log 404 errors only?
January 20, 2009 03:50PM
Igor Sysoev schrieb:

>> is there any way to log only HTTP codes >= 400 (maybe only 404 errors)
>> in the access.log? I'm not interested in successful delivery, redirects
>> or similar.
>
> location / {
> access_log off;
> error_page 404 /404;
> }
>
> location = /404 {
> access_log /path/to/log;
> }

hi Igor,

thank you very much!

Regards,

Peter
Sorry, only registered users may post in this forum.

Click here to login