I try to make Tomcat conditionally skip logging, so the access log isn't filled with lots of local application to application communication entries.
At the moment I have the following in server.xml:
<Valve className="org.apache.catalina.valves.RemoteIpValve" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/var/log/alfresco"
prefix="tomcat.access." suffix=".log" conditionUnless="???" pattern="combined" />
As you can see, I use the RemoteIpValve to show me the X-Forwarded-For values, instead of local IP's. But to filter the actual logging, I can see I can use 'conditionUnless' in Tomcat >7.0.30 (which I use). But After lots of searches, I can't find any working example and/or more detailed instructions than those in the Tomcat documentation about this Valve (https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve).
Can someone help me with an example and/or pointers on how to exclude the following:
- everything coming from IP "127.0.0.1" and/or
- all traffic to the application / relative URL: "/abc/.*"
Desparately, I already filled in "/abc/.*" as the value for conditionUnless (in the place of the questionmarks), but that didn't do anything.