<div dir="ltr">Hi Maxim,<div>I tried to configure the location with this example:</div><div><br></div><div>server  {</div><div>        access_log  logs/access_log sslclient;</div><div><br></div><div>        location / {</div><div><br>            if ($ssl_client_verify != "SUCCESS") {<br>                set $loggingcert 1;<br>            }<br><br>            access_log  logs/access_log sslclientfull if=$loggingcert;<br><br>        }<br></div><div><br></div><div>}</div><div><br></div><div>I noticed that all the request inherit the first access_log configuration and not the conditional.</div><div><br></div><div>Marcello</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 25, 2019 at 3:19 PM Maxim Dounin <<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
On Thu, Jul 25, 2019 at 05:08:30AM -0400, <a href="mailto:cello86@gmail.com" target="_blank">cello86@gmail.com</a> wrote:<br>
<br>
> Hi All,<br>
> we tried to add some debug information into our access_log for a service<br>
> with a client certificate authentication. Actually we print some information<br>
> related to the clients but we would print into the logs the client<br>
> certificate sent by the client during the handshake in case of error. We<br>
> tried to put the generic logformat into the server block and another<br>
> logformat into the if condition, but the first wins always versus the<br>
> second.<br>
> <br>
> Is it possible to config the logformat in a conditional statement?<br>
<br>
Yes, check the "if=" parameter of the access_log directive.  See <br>
here for details:<br>
<br>
<a href="http://nginx.org/r/access_log" rel="noreferrer" target="_blank">http://nginx.org/r/access_log</a><br>
<br>
-- <br>
Maxim Dounin<br>
<a href="http://mdounin.ru/" rel="noreferrer" target="_blank">http://mdounin.ru/</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>