Logger log = LoggerFactory.getLogger(getClass()); 这个方式获取的对象输出日志没办法在log4j.properties 配置输出级别。
后台一直输出quartz日志, 在log4j.properties 中指定log4j.logger.org.quartz.core.QuartzSchedulerThread=INFO 无效。
log4j 配置:
log4j.rootLogger=info,Console,Rolling
log4j.logger.org.quartz.core.QuartzSchedulerThread=INFO
log4j.appender.Console.MaxBackupIndex=3
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%-5p] %d{MM/dd HH:mm:ss.SSS} %l %t - %m%n
log4j.appender.Rolling=org.apache.log4j.RollingFileAppender
log4j.appender.Rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.Rolling.layout.ConversionPattern=%d{MM/dd HH:mm:ss.SSS} - %m%n
log4j.appender.Rolling.MaxFileSize=100MB
log4j.appender.Rolling.MaxBackupIndex=9
log4j.appender.Rolling.File=C:/logs/station.log
16:50:28.655 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:50:53.846 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:51:18.241 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:51:43.079 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:52:12.563 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:52:40.990 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:53:10.400 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:53:38.663 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:54:05.519 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
16:54:31.402 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 1 triggers
16:55:00.000 [NutzbookScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers