<div dir="ltr"><div class="">Hello Folks,<br></div>
<div>
<div class="" itemprop="text">
<p>How can we remove request url being logged in nginx error logs. For example it looks something like:</p>
<p>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: <a href="http://test.example.com">test.example.com</a>, request: "GET
/v1.3/status.json?...."</p>
<p>is it possible to drop request from the log(if present) so it looks something like:</p>
<p>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: <a href="http://test.example.com">test.example.com</a></p>
<p>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 <a href="https://github.com/cfsego/ngx_log_if">https://github.com/cfsego/ngx_log_if</a> does for access logs. I see that error_log is part of nginx core <a href="https://github.com/cfsego/ngx_log_if/blob/master/ngx_http_aclog_bypass_module.c">https://github.com/cfsego/ngx_log_if/blob/master/ngx_http_aclog_bypass_module.c</a>, 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.</p><p>Any suggestion/direction to achieve this is really appreciated.<br></p></div></div><br clear="all"><br>-- <br><div class="gmail_signature">Thanks & Regards,<br>Gaurav Gupta<div>7676-999-350<br><br>"Quality is never an accident. It is always result of intelligent effort" - John Ruskin<br></div></div>
</div>