SpringBoot 运行报log4j:WARN No appenders could be found for logger
warning如下:log4j:WARN No appenders could be found for loggerlog4j:WARN Please initialize the log4j system properly.原因是log4j默认的配置文件在src下,src没有log4j.properties导致报warning将配置文件log4j.properties放入到…\sr...
·
warning如下:
log4j:WARN No appenders could be found for logger
log4j:WARN Please initialize the log4j system properly.
原因是log4j默认的配置文件在src下,src没有log4j.properties导致报warning
将配置文件log4j.properties放入到…\srvc\main\resources下
log4j.rootCategory=INFO, Console, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
#配置log文件存储位置
log4j.appender.file.file=F:\\data\\logs\\twc.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c{1}:%L - %m%n
log4j.appender.file.MaxFileSize=102400KB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c{1}:%L - %m%n
更多推荐
已为社区贡献3条内容
所有评论(0)