Runtime tools : Runtime Tools : Problem Determination Trace : Using Log4j2 as target for Problem Determination Trace output
  
Using Log4j2 as target for Problem Determination Trace output
To use Log4j2 for Problem Determination Trace output, you must create log4j2.xml in the root of project, based on the following template:
<?xml version="1.0" encoding="UTF-8"?>
<!-- OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL -->
<configuration status="WARN" monitorInterval="30">
<appenders>
<console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] - %m%n"/>
</console>
<RollingFile name="BTT_PDTrace_MUTE" fileName="/Users/jhh/Desktop/logs/pdtrace_mute.log" filePattern="/Users/jhh/Desktop/logs/pdtrace_mute-%d{yyyy-MM-dd}-%i.log">
<ThresholdFilter level="FATAL"/>
<PatternLayout pattern=" %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="10240 KB"/>
</Policies>
</RollingFile>
<RollingFile name="BTT_PDTrace_DIRECT" fileName="/Users/jhh/Desktop/logs/pdtrace_direct.log" filePattern="/Users/jhh/Desktop/logs/pdtrace_direct-%d{yyyy-MM-dd}-%i.log">
<Filters>
<ThresholdFilter level="INFO"/>
<ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/>
</Filters>
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] - %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="10240 KB"/>
</Policies>
</RollingFile>
</appenders>
<loggers>
<root level="all">
<appender-ref ref="Console"/>
<appender-ref ref="BTT_PDTrace_MUTE"/>
<appender-ref ref="BTT_PDTrace_DIRECT"/>
</root>
</loggers>
</configuration>
To use Log4j2 for Problem Determination Trace output, copy the Log4j2 jar files to the library path. The following table details the jar files that are required in the library path depending on the version of Java that is installed in the server runtime environment.
Java version in server runtime environment
Log4j2 jar files required in library path
Java 1.6 or higher
log4j-api-2.16.1.jar
log4j-core-2.16.1.jar
For more information on the use of the Log4j2 configuration, see http://commons.apache.org/logging/guide.html and http://logging.apache.org/log4j/.
See also:
Configuring Problem Determination Trace.
Example Problem Determination Trace configuration.
Go up to
Problem Determination Trace