`
mwhgJava
  • 浏览: 98765 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

log4j:WARN Please initialize the log4j system properly 解决方案

阅读更多
使用log4j时候,出现这个警告:
log4j:WARN No appenders could be found for logger (***).
log4j:WARN Please initialize the log4j system properly.

问题原因:没有正确配置log4j配置文件。
log4j默认从系统属性中的log4j.configuration获取log4j配置文件的url,找不到就从classpath中找 log4j.xml文件为配置文件,找不到就从classpath中找log4j.properties配置文件。如果找不到,就打印上面的出错信息。详情见log4j源码,org.apache.log4j.LogManager.java文件。

详情参考本人日志: Log4j笔记 第一章 简单用上Log4j

分享到:
评论

相关推荐

    log4j日志报错解决办法

    在Java开发过程中,如果遇到"log4j:WARN Please initialize the log4j system properly"这样的错误提示,通常意味着Log4j没有正确配置或者找不到配置文件。 首先,错误信息"log4j:WARN No appenders could be found...

    JAVACCC.DLL

    log4j:WARN Please initialize the log4j system properly log4j:WARN No appenders could be found for logger org apache commons beanutils ConvertUtils 出现这个错误 在web inf classes路径下加了log4j ...

    log4j-1.2.14.jar

    报错WARN No appenders could be found for logger 或 WARN Please initialize the log4j system properly时需要引入的包。用法可以参考https://blog.csdn.net/u010912188/article/details/79761894

    quartz log4j

    log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog). log4j:WARN Please initialize the log4j system properly.

    log4j.properties

    当ssm项目出现下面的警告: log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging....log4j:WARN Please initialize the log4j system properly. 将这个文件放到resources目录下,消除警告。

    log4j使用j

    通过上述方法,我们可以有效地解决“log4j:WARN Please initialize the log4j system properly”的警告,并根据不同需求定制化日志输出级别和目的地。在实际开发过程中,合理配置Log4j不仅有助于提高代码的可维护性...

    hadoop-2.6.0-hadoop.dll-winutils.exe

    log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" java.lang.NullPointerException  ...

    tomcat排错经典案例之404.docx

    log4j:WARN Please initialize the log4j system properly. 2009-11-06 21:39:17 org.apache.catalina.core.StandardContext start 严重: Error listener Start 2009-11-06 21:39:17 org.apache.catalina.core....

    struts2驱动包

    log4j:WARN Please initialize the log4j system properly. 2009-8-29 14:02:12 org.apache.catalina.core.ApplicationContext log 信息: Loading Spring root WebApplicationContext 2009-8-29 14:02:25 org.apache...

    php.ini-development

    Please see the actual settings later in the document for more details as to why ; we recommend these changes in PHP's behavior. ; display_errors ; Default Value: On ; Development Value: On ; ...

Global site tag (gtag.js) - Google Analytics