Need to exclude file from server logs

Dont know if this is even possible but I have a healthcheck file that is
checked by a load balancer every 30 seconds. However, I really do not
want the webserver to be logging this. Is there some way to configure
the server to ignore a file or directory as far as the logging is
concerned??

Running nginx 0.7.65 on Ubuntu 10.04

Brian

Posted at Nginx Forum:

once in 30 seconds… Do you really need that?
Anyway, cat access.log | grep -v “loadbalanced.check.txt” should help
you.

location = /healthcheckfile {
access_log off;
}
should do the trick.

Posted at Nginx Forum:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/22/2011 12:26 PM, bindsocket wrote:

Dont know if this is even possible but I have a healthcheck file
that is checked by a load balancer every 30 seconds. However, I
really do not want the webserver to be logging this. Is there some
way to configure the server to ignore a file or directory as far as
the logging is concerned??

Running nginx 0.7.65 on Ubuntu 10.04

I don’t know if it’s the best way to configure a healthcheck, but:

    location = /healthcheck_nginx.html {
            access_log   off;
            root /usr/share/nginx/html;
            index healthcheck_nginx.html;
    }

hope this helps.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1j2CUACgkQNRQApncg296c9gCdFQ15ofUwV1lsrqMv72fRcQn2
0xgAn10L3OT0f2rlvabrOriLz3kYk0UC
=3UMW
-----END PGP SIGNATURE-----

On 22 Fev 2011 15h26 WET, [email protected] wrote:

Dont know if this is even possible but I have a healthcheck file
that is checked by a load balancer every 30 seconds. However, I
really do not want the webserver to be logging this. Is there some
way to configure the server to ignore a file or directory as far as
the logging is concerned??

Try: Module ngx_http_stub_status_module

— appa

Thanks all. Access log is much prettier now.
And as far as the every 30 seconds thing, the suggestion from the server
was 15 seconds. Probably be changing it to much longer as we are going
to be doing something else for a health check eventually anyways. Still
dont want to bother with logging it regardless.
Just the simple:

location /hc {
access_log off;
}

worked just fine for this application.

Posted at Nginx Forum:

On Tue, Feb 22, 2011 at 12:37:11PM -0300, Flavio Torres wrote:

Running nginx 0.7.65 on Ubuntu 10.04

hope this helps.

“index healthcheck_nginx.html” is useless here: it’s required for
requests with trailing slash, but this location works only for
“/healthcheck_nginx.html”.

Also “root” probably can be inherited from server level.


Igor S.
http://sysoev.ru/en/

I ended up using the root command for this since I wanted to put the
healthcheck file in a different directory than the root of the main web
content.

Posted at Nginx Forum:

On Tue, Feb 22, 2011 at 11:02:47AM -0500, bindsocket wrote:

worked just fine for this application.

If you request exactly “/hc”, then it’s better to use

location = /hc {
access_log off;
}


Igor S.
http://sysoev.ru/en/