Tomcat 9.

I wanted to separate out access logs for external api calls to log different 
info than the standard access log line. For example, the api key used which is 
set as a request header.

Adding that to the pattern was easy. 

However the conditional logging was clunky. I found the ‘conditionIf’ and 
‘conditionUnless’ attributes for the access log valve, but these only work on 
request attributes, not headers (at least that’s what the documentation says).

I have created a filter that copies the values from the request headers to 
equivalent  attributes, just so the condition can work. This is where it feels  
clunky, especially since the access log valve has replacement parameters for 
logging request headers.

Is there a technical reason why the condition checking can’t work on request 
headers in the valve? If not, can this be considered as a feature request 
please?

Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to