关于log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).的问题

几天初换IDEA编写java代码,感觉十分的爽,所以决定抛弃eclipse

---------------------------------------上面是题外话--------

今天在运行某程序时出现了如上图所示的问题,查找资料后发现是由于由于log4j这个日志信息打印模块的配置信息没有给出造成的,简单的说就是人家要有个地方来存放日志的打印信息,可是你又不给人家,所以就报错了吧

解决办法:

在你的项目的src目录中创建一个名为log4j.properties的文本文件,记住是文本文件,不是文件夹

然后在你的文本文件中加入如下的内容:

# Configure logging for testing: optionally with log file  

#log4j.rootLogger=debug,appender
log4j.rootLogger=info,appender
#log4j.rootLogger=error,appender  

#\u8F93\u51FA\u5230\u63A7\u5236\u53F0
log4j.appender.appender=org.apache.log4j.ConsoleAppender
#\u6837\u5F0F\u4E3ATTCCLayout
log4j.appender.appender.layout=org.apache.log4j.TTCCLayout
时间: 2024-10-04 17:54:17

关于log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).的问题的相关文章

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

Hadoop: No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).解决办法

在eclipse中运行Hadoop程序时出现如下问题: 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.org/log4j/1.2/faq.html#

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

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

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