Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bom/logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<!-- Bridge java.util.logging (Tomcat JULI) into Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<!-- Async support for Log4J 2.x -->
<groupId>com.lmax</groupId>
Expand Down
13 changes: 13 additions & 0 deletions dotCMS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,12 @@
<artifactId>log4j-appserver</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<!-- Added to tomcat classpath: bridges JULI (java.util.logging) into Log4j2 -->
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<!-- Async support for Log4J 2.x -->
<groupId>com.lmax</groupId>
Expand Down Expand Up @@ -1697,6 +1703,13 @@
<overWrite>false</overWrite>
<outputDirectory>${tomcat-log4j-lib-folder}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${tomcat-log4j-lib-folder}</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -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.<date>.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
# 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
Loading