spring boot 解决日志警告
- log4j:WARN No appenders could be found for logger (com.netease.qa.testng.TestngRetry).
- log4j:WARN Please initialize the log4j system properly.
原因是没有对log4j这个jar进行文件配置。将log4j.properties文件放在src目录下就可以了。
新建配置文件 log4j.properties
log4j.rootLogger=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=firestorm.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.com.codefutures=DEBUG