Minimal log4j.properties file

Here’s a minimal log4j properties file defining a console appender and pattern formatter:

log4j.rootLogger=DEBUG, console

#console appender
log4j.appender.console=org.apache.log4j.ConsoleAppender

#define patternlayour for console appender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.