Log4j 可以每日生成一个新文件的配置-log4j.properties

log4j.rootLogger=info,stdout,logfile
#stdout configure
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern= %d %p -%l - <%m>%n
#logfile configure
log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.logfile.File=../logs/Datashop.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern= %d %p  -%l - <%m>%n
#log4j.logger.com.mapbar=DEBUG
log4j.logger.com.mapbar.web.filter=ERROR
#log4j.logger.org.apache=WARN
 

 

你可能感兴趣的:(Log4j 可以每日生成一个新文件的配置-log4j.properties)