log4j 根据类名指定文件

时间:2021-11-26 10:17:27

log4j.logger.io.netty=INFO, stdout, spider
log4j.logger.com.ld.net.spider=INFO, stdout, spider

log4j.appender.spider=org.apache.log4j.RollingFileAppender
log4j.appender.spider.File=../logs/spider.log
log4j.appender.spider.Append=true
log4j.appender.spider.MaxFileSize=10MB
log4j.appender.spider.MaxBackupIndex=100
log4j.appender.spider.layout=org.apache.log4j.PatternLayout
log4j.appender.spider.layout.ConversionPattern=%d{yy-MM-dd HH:mm:ss} %p %t %c: %m%n