Log4j官方sample配置

log4j.rootLogger=info, stdout, R

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=[%p]%d{yyyy-MM-dd HH:mm:ss,SSS} [%F:%L] %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=D:\\JointForce\\7.EasyCluster\\Interface\\Develop\\log\\ecrolling.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern==[%p]%d{yyyy-MM-dd HH:mm:ss,SSS} [%C:%L] %m%n

你可能感兴趣的:(sample)