java.util.logging
for all Tomcat's internal logging.First of all it is nothing special because it will use the log4j over slf4 and logback.
- Download
tomcat-juli.jar
andtomcat-juli-adapters.jar
that are available as an "extras" component for Tomcat. See Additional Components documentation for details. - Put the following jars into
$CATALINA_HOME/lib
.- log4j-over-slf4j-1.6.4.jar
- logback-classic-1.0.0.jar
- logback-core-1.0.0.jar
- slf4j-api-1.6.4.jar
- tomcat-juli-adapters.jar
- Replace
$CATALINA_HOME/bin/tomcat-juli.jar
withtomcat-juli.jar
from "extras" - Delete
$CATALINA_BASE/conf/logging.properties
to prevent java.util.logging generating zero length log files. - Add
logback.xml
into$CATALINA_HOME/lib
.
Example:<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<!--
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
-->
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Keine Kommentare:
Kommentar veröffentlichen