首页 > 代码库 > ELK错误汇总

ELK错误汇总

错误一:

log4j:WARN No appenders could be found for logger

(org.springframework.context.support.ClassPathXmlApplicationContext).

log4j:WARN Please initialize the log4j system properly.

 

Spring 使用了LOG4J 这个开源框架来输出信息,

要解决这个问题非常简单,建立LOG4J 的配置文件即可。在src 目录下创建配置文件,选

择菜单File > New > File,文件名输入log4j.properties,文件内容如下所示:

log4j.rootLogger=WARN, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

 

ELK错误汇总