log4j config example

Thanks to Kevin Dougan - I found this online.

log4j.threshold=ALL
  log4j.rootLogger=ALL, stdout, DebugAppender, InfoAppender, WarnAppender, ErrorAppender
                                                                                                                                                 
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%c %d{ISO8601} -- %p -- %m%n
                                                                                                                                                 
  log4j.appender.DebugAppender=org.apache.log4j.RollingFileAppender
  log4j.appender.DebugAppender.File=/home/madan/learn/java/app-debug.log   log4j.appender.DebugAppender.MaxFileSize=9KB   log4j.appender.DebugAppender.MaxBackupIndex
  log4j.appender.DebugAppender.layout=org.apache.log4j.PatternLayout
  log4j.appender.DebugAppender.layout.ConversionPattern=%c %d{ISO8601} -- %p -- %m%n
  log4j.appender.DebugAppender.Threshold?BUG
                                                                                                                                                 
  log4j.appender.InfoAppender=org.apache.log4j.RollingFileAppender
  log4j.appender.InfoAppender.File=/home/madan/learn/java/app-info.log
  log4j.appender.InfoAppender.MaxFileSize=9KB
  log4j.appender.InfoAppender.MaxBackupIndex
  log4j.appender.InfoAppender.layout=org.apache.log4j.PatternLayout
  log4j.appender.InfoAppender.layout.ConversionPattern=%c %d{ISO8601} -- %p -- %m %n
  log4j.appender.InfoAppender.Threshold=INFO                                                                                                                                                  
  log4j.appender.WarnAppender=org.apache.log4j.RollingFileAppender
  log4j.appender.WarnAppender.File=/home/madan/learn/java/app-warn.log
  log4j.appender.WarnAppender.MaxFileSize=5KB
  log4j.appender.WarnAppender.MaxBackupIndex
  log4j.appender.WarnAppender.layout=org.apache.log4j.PatternLayout
  log4j.appender.WarnAppender.layout.ConversionPattern=%c %d{ISO8601} -- %p -- %m %n
  log4j.appender.WarnAppender.Threshold=WARN
                                                                                                                                                 
  log4j.appender.ErrorAppender=org.apache.log4j.RollingFileAppender   log4j.appender.ErrorAppender.File=/home/madan/learn/java/app-error.log   log4j.appender.ErrorAppender.MaxFileSize=5KB   log4j.appender.ErrorAppender.MaxBackupIndex   log4j.appender.ErrorAppender.layout=org.apache.log4j.PatternLayout
  log4j.appender.ErrorAppender.layout.ConversionPattern=%c %d{ISO8601} -- %p -- %m%n
  log4j.appender.ErrorAppender.Threshold=ERROR

log4jconfig.txt · Last modified: 2014/10/26 01:52 (external edit)
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0