What I am trying to do: I want to add a AccessLogValve to the tomcat server.xml so that I can log custom header values. (ref: https://jfrog.com/knowledge-base/how-can-i-log-custom-request-headers-using-the-tomcat-access-log-valve/)
Problem I am having:
Every-time the gradle is run it creates new server.xml. I want to add a cargo.tomcat.valve
container property however I cannot find a format that works.
The valve I want to add is the Access Log Valve
https://tomcat.apache.org/tomcat-8.5-doc/config/valve.html#Access_Log_Valve
A failed example is containerProperties ['cargo.tomcat.valve'] = 'className=org.apache.catalina.valves.AccessLogValve| pattern=combined'
I have tried various versions of the above but none seem to work.
I can see that the maven example is
<cargo.tomcat.valve.stuckthread>
className=org.apache.catalina.valves.StuckThreadDetectionValve|
threshold=60
</cargo.tomcat.valve.stuckthread>
However I cannot find a way to add custom valves using gradle.