slf4j 整合log4j 报错 WARN Please initialize the log4j system properly.

		<!-- slf4j 整合 log4j maven项目只需要引入这一个包即可 会依赖下载其他包-->
		 <dependency>
		    <groupId>org.slf4j</groupId>
		    <artifactId>slf4j-log4j12</artifactId>
		    <version>1.7.21</version>
	 	 </dependency>

slf4j 整合log4j   报错  WARN Please initialize the log4j system properly.
错误:
log4j:WARN Please initialize the log4j system properly.

slf4j 如果用 log4j 需要添加log4j的配置文件log4j.properties(必须填写内容)

比如随便写点儿:log4j.properties

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=1log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

log4j.logger.com.codefutures=DEBUG
上一篇:C语言输入与输出


下一篇:1,python 之 paramiko模块