You are on page 1of 1

#### Use two appenders, one to log to console, another to log to a file log4j.

rootCategory=error, stdout, R #### First appender writes to console log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss.SSS} %5p [%t] (%F%L) - %m%n #### Second appender writes to a file log4j.appender.R=org.apache.log4j.RollingFileAppender # log4j.appender.R.File=${user.home}/SamsungConnect/log4j.log log4j.appender.R.File=C:/Samsung Link/Logs/log4j.log # Control the maximum log file size log4j.appender.R.MaxFileSize=5MB # Archive log files (one backup file here) log4j.appender.R.MaxBackupIndex=2 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{HH:mm:ss.SSS} %p %t %c - %m%n

You might also like