Welcome! Log In Create A New Profile

Advanced

Remove request from nginx error logs

gaurav gupta
September 10, 2015 09:22AM
Hello Folks,

How can we remove request url being logged in nginx error logs. For example
it looks something like:

2015/09/01 15:26:03 [error] 30547#0: *208725 upstream prematurely closed
connection while reading response header from upstream, client:
123.123.50.44, server: test.example.com, request: "GET
/v1.3/status.json?...."

is it possible to drop request from the log(if present) so it looks
something like:

2015/09/01 15:26:03 [error] 30547#0: *208725 upstream prematurely closed
connection while reading response header from upstream, client:
123.123.50.44, server: test.example.com

I was able to configure access logs but couldn't find a way to customize
error logs. If there is no way to drop just request, is it possible to drop
complete error logs matching a particular format something similar to what
https://github.com/cfsego/ngx_log_if does for access logs. I see that
error_log is part of nginx core
https://github.com/cfsego/ngx_log_if/blob/master/ngx_http_aclog_bypass_module.c,
but would it be possible to extend by creating a new nginx module. I am
really sorry since I am new to nginx code/module and this might sound
stupid.

Any suggestion/direction to achieve this is really appreciated.


--
Thanks & Regards,
Gaurav Gupta
7676-999-350

"Quality is never an accident. It is always result of intelligent effort" -
John Ruskin
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Remove request from nginx error logs

gaurav gupta September 10, 2015 09:22AM

Re: Remove request from nginx error logs

Francis Daly September 12, 2015 11:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready