diff --git a/bom/logging/pom.xml b/bom/logging/pom.xml index fb2d98a93f0a..27915dc4437f 100644 --- a/bom/logging/pom.xml +++ b/bom/logging/pom.xml @@ -77,6 +77,13 @@ ${log4j.version} runtime + + + org.apache.logging.log4j + log4j-jul + ${log4j.version} + provided + com.lmax diff --git a/dotCMS/pom.xml b/dotCMS/pom.xml index 17aa12780c8f..4a89e930a65b 100644 --- a/dotCMS/pom.xml +++ b/dotCMS/pom.xml @@ -1433,6 +1433,12 @@ log4j-appserver provided + + + org.apache.logging.log4j + log4j-jul + provided + com.lmax @@ -1697,6 +1703,13 @@ false ${tomcat-log4j-lib-folder} + + org.apache.logging.log4j + log4j-jul + jar + false + ${tomcat-log4j-lib-folder} + org.apache.logging.log4j log4j-slf4j2-impl diff --git a/dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf/logging.properties b/dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf/logging.properties index 77f91c00c3d1..3173d3231b19 100644 --- a/dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf/logging.properties +++ b/dotCMS/src/main/docker/original/ROOT/srv/OVERRIDE/tomcat/conf/logging.properties @@ -1,14 +1,20 @@ -handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler - -.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler +# Route ALL Tomcat java.util.logging (JULI) records into Log4j2 so they share the +# single dotCMS Log4j2 configuration (Console -> stdout/container logs + dotcms.log). +# This replaces the legacy AsyncFileHandler (separate catalina..log) and the +# stock ConsoleHandler. Tomcat's org.apache.juli.logging facade is already routed to +# Log4j2 by log4j-appserver's TomcatLogger; this bridge additionally captures any code +# that logs directly via java.util.logging. +# +# NOTE: access logs are produced by Tomcat's AccessLogValve (server.xml), which writes +# directly to its own file and does NOT pass through JULI or this bridge -- so access +# logs remain a separate file, by design. +handlers = org.apache.logging.log4j.jul.Log4jBridgeHandler +.handlers = org.apache.logging.log4j.jul.Log4jBridgeHandler ############################################################ -# Handler specific properties. -# Describes specific configuration info for Handlers. +# Log4jBridgeHandler configuration ############################################################ -1catalina.org.apache.juli.AsyncFileHandler.level = INFO -1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs -1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina. -1catalina.org.apache.juli.AsyncFileHandler.maxDays = 2 -1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8 \ No newline at end of file +# Mirror the effective Log4j2 levels back onto the JUL loggers so JUL does not +# pre-filter records before they reach Log4j2. +org.apache.logging.log4j.jul.Log4jBridgeHandler.propagateLevels = true