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.
maven项目,在项目下建source folder “/src/test/resources”;
在上面路径下建一个文件log4j.properties;
将如下内容复制到log4j.properties
# For Testing Guys
# Set root logger level to error
log4j.rootLogger=INFO, Console ###### Console appender definition ####### # All outputs currently set to be a ConsoleAppender.
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{3}] %m%n
#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n ###### File appender definition #######
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=spring.log
log4j.appender.File.Append=false
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
log4j.rootLogger=debug, stdout, R log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p - %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=firestorm.log log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n log4j.logger.com.codefutures=DEBUG
log4j:WARN Please initialize the log4j system properly解决办法的更多相关文章
- log4j:WARN Please initialize the log4j system properly 问题解决
log4j:WARN No appenders could be found for logger (com.netease.qa.testng.TestngRetry).log4j:WARN Ple ...
- struts2 log4j:WARN Please initialize the log4j system properly. 解决方法
在tomcat启动的时候,出现这个警告: log4j:WARN No appenders could be found for logger (org.apache.commons.digester. ...
- log4j:WARN Please initialize the log4j system properly.解决
log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlA ...
- 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安装目录下的 e ...
- 【log4j】springboot项目启动 ,使用的druid数据源,log4j报错 log4j:WARN Please initialize the log4j system properly.
springboot项目启动 ,使用的druid数据源,log4j报错 -- :: --- [ restartedMain] o.hibernate.annotations.common.Versio ...
- log4j:WARN Please initialize the log4j system properly.
在tomcat启动的时候,出现这个警告: log4j:WARN No appenders could be found for logger (org.apache.commons.digester. ...
- log4j:WARN Please initialize the log4j system properly. 异常解决
log4j:WARN Please initialize the log4j system properly. 这个异常很少遇到,咋一看,原来是没有配置logger4j的配置文件 问题解决方法: 传统 ...
- log4j:WARN Please initialize the log4j system properly.解决方案
在使用quarz任务调度框架时的错误,实际上这个问题很常见,并不影响程序的使用,只是缺少日志输出,完整错误信息: log4j:WARN No appenders could be found for ...
- Spring框架 (log4j :WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly.)问题解决
Spring框架需要的jar包 1.Spring压缩包中的四个核心JAR包 beans .context.core 和expression 下载地址: https://pan.baidu.com/s/ ...
随机推荐
- Python —— 函数高级特性(切片、迭代、列表生成式、生成器、迭代器)
一.切片(Slice) 在很多编程语言中,针对字符串提供了很多截取函数(i.e. substring),目的就是对字符串切片.python中没有针对字符串的截取函数,需要通过“切片”来完成. 取一个 ...
- Treap标准模板
这是Treap的模板程序,支持Left/Right Rotate,Find the maxnum/minnum,Find the predecessor/successor of a node,Add ...
- servlet进行用户名和密码校验
效果截图: 链接:https://pan.baidu.com/s/1eR051bUPerpEM3TDLtq9Xw 提取码:rjpy
- 第二课 --- git的(管理修改和撤销修改、删除文件)
读取文本内容: cat readme.txt 查看工作区与脚本库里面的区别: git diff HEAD -- readme.txt 丢弃工作区的修改内容: git checkout -- readm ...
- Daily record-December
December 11. All circles have the same shape. 所有圆的形状都是相同的.2. She first drew a circle on the board. 她 ...
- learning websocket protocol
websocket的产生背景: 众所周知,Web应用的通信过程通常是客户端通过浏览器发出一个请求,服务器端接收请求后进行处理并返回结果给客户端,客户端浏览器将信息呈现.这种机制对于信息变化不是特别频繁 ...
- c语言操作文件函数大全
fopen(打开文件)相关函数 open,fclose表头文件 #include<stdio.h>定义函数 FILE * fopen(const char * path,const cha ...
- mybatis-spring和spring版本搭配问题
所报错误:org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer 匹配的版本(my ...
- SpringBoot配置Swagger实例(POST接收json参数)
工程目录结构: 首先,引入jar包,只需要以下两个即可 <dependency> <groupId>io.springfox</groupId> <artif ...
- hosts文件被修改后的惨案
在公司MAC电脑上/etc/hosts中尝试反向解析一个ip到localhost, 即:xxx.xxx.xxx.xxx localhost 然后发现tomcat起不来;