previous next TOC
Second MyApp example (2 of 4)

Here is a equivalent configuration file equivalent to invoking BasicConfigurator.configure method:
 
# Set root logger level to DEBUG and its only
# appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender which outputs to System.out.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


This sample configuration file results in exactly same output as the previous MyApp example.

Due to the maximum printable line width on some environments, the conversion pattern parameter is sometimes continued on the next line.

 

GET THE DOCS DIRECTLY FROM THE DEVELOPER
For up to date and detailed log4j documentation directly from the developer please consider The complete log4j manual.