解决log4j:WARN No appenders could be found for logger

这个问题是因为我们的log4j.properties文件配置不够完整,所以我们给它配置齐了就不会再出现这个问题。
log4j.properties不完整配置如下:

log4j.rootLogger=DEBUG, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n

log4j.logger.java.sql.PreparedStatement=DEBUG

时间: 2024-10-22 16:17:38

解决log4j:WARN No appenders could be found for logger的相关文章

spring解决"log4j:WARN No appenders could be found for logger"

1 在src下面新建file名为log4j.properties内容如下: # Configure logging for testing: optionally with log file log4j.rootLogger=WARN, stdout # log4j.rootLogger=WARN, stdout, logfile log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout

使用hibernate出现log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version). log4j:WARN Please initialize the log4j system properly.问题的解决办法

问题描述: log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).log4j:WARN Please initialize the log4j system properly. 问题分析: 大概意思就是它没读到log4j的配置信息,然后让你导入它什么的(差不多是这个意思,可能是你导入了,但没配置好) 解决方法: 从原因上分析,其实它是找不到它需要的那个名为log4j.pr

log4j:WARN No appenders could be found for logger 解决办法

转自:https://blog.csdn.net/chw0629/article/details/80567936 使用log4j时不起作用,每次执行完出现以下提示: log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory). log4j:WARN Please initialize the log4j system properly.log4j:WARN See http:/

log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment)的解决

报错:log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment). 出错原因:缺少日志文件,主要是后面的原因org.springframework.core.env.StandardEnvironment 解决方案:在resource中添加对应的log4j.properties文件,文件内容为 log4j.rootLogger=DEBUG,A1log4j.

eclipse:log4j:WARN No appenders could be found for logger

在src下面新建file名为log4j.properties内容如下: # Configure logging for testing: optionally with log file log4j.rootLogger=WARN, stdout log4j.rootLogger=INFO,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.lo

关于控制台输出 警告 log4j:WARN No appenders could be found for logger

新建struts2项目时出现警告 log4j:WARN No appenders could be found for logger 于是上网搜查了解决方案 转自:最爱NBA 在src下面新建file名为log4j.properties内容如下: # Configure logging for testing: optionally with log filelog4j.rootLogger=WARN, stdout# log4j.rootLogger=WARN, stdout, logfile

log4j:WARN No appenders could be found for logger

log4j:WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly. 如果启动时候报如上警告,有两种办法: 1. 检查log4j.properties or log4j.xml是否被load成功了(加载机制见源码:org.apache.log4j.LogManager.class): 2. 检查log4j.properties中有没有定义相应的logger

maven:log4j:WARN No appenders could be found for logger (loggerInfo).或者maven build error:org.apache.maven.lifecycle.LifecycleExecutionExceptio

maven在build构建时,加载资源文件时需要配置资源文件插件: 1,在pom.xml文件中加入 <build> <finalName>${project.build.target.file.name}</finalName> <directory>${basedir}/target</directory>  <sourceDirectory>${basedir}/src/main/java</sourceDirectory&

log4j log4j:WARN No appenders could be found for logger

web项目用log4j配置文件,结果死活不生效,仔细检查配置文件没有问题,结果一直报 log4j:WARN No appenders could be found for logger 火大,于是把源代码拿下来debug,一步步执行,最后终于找到了元凶,泪流满面 原因:log4j的配置文件是带BOM的UTF-8格式,文件最开头有BOM的3字节EF BB BF, 导致log4j.rootLogger 变成了 xxxlog4j.rootLogger (xxx不可见) log4j初始化的时候用root