[1331802 views]

[]

[ads]

Odi's astoundingly incomplete notes

New entries | Code

Log4J Properties Template

As I tend to forget the config file format for Log4J let me post this template here:
log4j.rootCategory=DEBUG, C
# log categories
log4j.logger.org.apache=ERROR

# stdout
log4j.appender.C=org.apache.log4j.ConsoleAppender
log4j.appender.C.layout=org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.C.Target=System.out

# single file
log4j.appender.F=org.apache.log4j.FileAppender
log4j.appender.F.layout=org.apache.log4j.PatternLayout
log4j.appender.F.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.F.File=server.log

# rotating log files
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.R.File=server.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=3

posted on 2005-08-15 13:03 UTC in Code | 0 comments | permalink