docker-pega-web-ready icon indicating copy to clipboard operation
docker-pega-web-ready copied to clipboard

enable the configuration of maxDays attribute for Access Log Valve

Open byroncollins opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. The housekeeping/purging of localhost_access_logs cannot be managed using configuration. The logs rotate every day for the life of the container.

Describe the solution you'd like I would like to add the maxDays attribute whose value can be adjusted using an environment variable.

This would require set_env.sh to add the following system property to CATALINA_OPT

CATALINA_OPTS="$CATALINA_OPTS -Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.EnvironmentPropertySource

I propose that the default value of maxDays be -1, which means never deleting the old files, which matches existing behaviour.

Describe alternatives you've considered We add this value when building our pega containers using the pega-ready container as the base, but the retention period is hardcoded.

LINE=$(grep -n "prefix=\"localhost_access_log\"" ${CATALINA_HOME}/conf/server.xml | cut -d: -f1) \
 sed -i "${LINE}s/$/ maxDays\=\"90\"/" ${CATALINA_HOME}/conf/server.xml

Additional context Add any other context or screenshots about the feature request here.

byroncollins avatar Mar 31 '23 03:03 byroncollins