I would like to know if there any way by which we can do conditional logging in apache access logs. AccessLogValve from $CATALINA_HOME/conf/server.xml
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%{X-Forwarded-For}i %h %l %u %t "%r" %s %b" />
<Context path="" docBase="/usr/share/tomcat8/webapps/ROOT/www" reloadable="true" crossContext="true"/>
For example: I don't want to log a URL which passes sensitive information /email/somesensitve information. Is there any way I can specify this in server.xml or any other ways.
This is how we could specify in apache httpd https://www.howtoforge.com/setenvif_apache2 SetEnvIf Request_URI "^/email/token$" dontlog