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.appender.A1=org.apache.log4j.ConsoleAppenderlog4j.appender.A1.layout=org.apache.log4j.PatternLayoutlog4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n

或者

# 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=org.apache.log4j.PatternLayout

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

log4j.appender.logfile=org.apache.log4j.FileAppender

log4j.appender.logfile.File=target/spring.log

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

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

原文地址:https://www.cnblogs.com/codething/p/8590042.html

时间: 2024-10-03 07:14:39

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).

今天在学习使用spring注解的时候提示警告: 解决办法: 添加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 log

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

spring解决&quot;log4j:WARN No appenders could be found for logger&quot;

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 (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.o

上面的报错是在本地java调试(windows) hadoop集群 出现的 解决方案: 在resources文件夹下面创建一个文件log4j.properties(这个其实hadoop安装目录下的 etc/hadoop/log4j.properties 同名,我尝试拿过来用,发现还是不行报错信息如下) log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFa