This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit b6e87fcfb4649b189f960ed7661eb57dedf65a29 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Sun Apr 28 08:48:20 2024 +0200 Improved: Use new Tomcat 9 maxDays Access_Log_Valve Attribute (OFBIZ-13073) https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Log_Valve --- framework/catalina/ofbiz-component.xml | 10 ++++++---- .../org/apache/ofbiz/catalina/container/CatalinaContainer.java | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/framework/catalina/ofbiz-component.xml b/framework/catalina/ofbiz-component.xml index c15c2acf86..e776745b19 100644 --- a/framework/catalina/ofbiz-component.xml +++ b/framework/catalina/ofbiz-component.xml @@ -43,6 +43,7 @@ under the License. <property name="access-log-rotate" value="true"/> <property name="access-log-prefix" value="access_log."/> <property name="access-log-dir" value="runtime/logs"/> + <property name="access-log-maxDays" value="30"/> <!-- uncomment for cluster support <property name="default-server-cluster" value="cluster"> <property name="rep-valve-filter"> @@ -76,16 +77,16 @@ under the License. <property name="xpoweredBy" value="false"/> <!-- AJP/13 connector attributes --> <!-- Despite OFBIZ-11407, allowedRequestAttributesPattern is commented out because of OFBIZ-12558 - OOTB the Tomcat default values are used as recommended by + OOTB the Tomcat default values are used as recommended by https://tomcat.apache.org/tomcat-9.0-doc/config/ajp.html#Introduction - This is in relation with + This is in relation with https://tomcat.apache.org/security-9.html#Fixed_in_Apache_Tomcat_9.0.31 and https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html#Connectors - + But OOTB secretRequired value must be false because secret value is empty Else a notifying message appears in log saying that AJP is not available. - + Long story short, with OOTB configuration only localhost works. So if you want to use AJP you need to set the values depending on your configuration. Using ".*" to allowedRequestAttributesPattern put you at risk. @@ -193,6 +194,7 @@ under the License. <property name="access-log-rotate" value="true"/> <property name="access-log-prefix" value="access_log."/> <property name="access-log-dir" value="runtime/logs"/> + <property name="access-log-maxDays" value="30"/> <property name="enable-request-dump" value="false"/> </property> <property name="ajp-connector" value="connector"> diff --git a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java index fed9118d3f..f5fa8feefe 100644 --- a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java +++ b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java @@ -405,6 +405,7 @@ public class CatalinaContainer implements Container { accessLogValve.setPrefix(accessLogPrefix); } accessLogValve.setRotatable(ContainerConfig.getPropertyValue(engineConfig, "access-log-rotate", false)); + accessLogValve.setMaxDays(Integer.valueOf(ContainerConfig.getPropertyValue(engineConfig, "access-log-maxDays", null))); engineValves.add(accessLogValve); }