Forum: NGINX Log 404 errors only?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Peter Hinse (Guest)
on 2009-01-20 15:53
(Received via mailing list)
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 S. (Guest)
on 2009-01-20 16:00
(Received via mailing list)
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;
      }
Peter Hinse (Guest)
on 2009-01-20 16:43
(Received via mailing list)
Igor S. schrieb:

>           access_log  /path/to/log;
>       }

hi Igor,

thank you very much!

Regards,

  Peter
This topic is locked and can not be replied to.