你的位置:首页 > 软件开发 > Java > Spring框架 (log4j :WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly.)问题解决

Spring框架 (log4j :WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly.)问题解决

发布时间:2017-11-23 13:00:13
Spring框架需要的jar包1、Spring压缩包中的四个核心JAR包beans 、context、core 和expression下载地址:https://pan.baidu.com/s/1qXLHzAW2、以及日志jar包commons-logging 和log4j下载地址 ...

Spring框架 (log4j :WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly.)问题解决

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/1qXLHzAW

2、以及日志jar包

commons-logging 和log4j

下载地址:

https://pan.baidu.com/s/1mimTW5i

3、再增加一个

spring-aop-5.0.1.RELEASE.jar (用于注解,在Spring-framework库中包含)

4、再增加

spring-aspects-5.0.1.RELEASE.jar (在Spring-framework库中包含)

aspectjweaver-1.8.12.jar (官方下载地址             (官方下载地址 >#日志等级#TRACE:详细等级,堆栈信息#debug:类似于System.out.print#info:类似于Hibernate的show_sql#warn:不影响运行, 只是提示#error:出现异常#全局日志等级配置,输出位置log4j.rootLogger=info,stdout,logfile#stdout控制器log4j.appender.stdout=org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.Target=System.outlog4j.appender.stdout.layout=org.apache.log4j.PatternLayout#输出格式log4j.appender.stdout.layout.ConversionPattern=%d %p [%c]:%L - %m%n#文件路径输出log4j.appender.logfile=org.apache.log4j.RollingFileAppender#默认输出到tomcat的根路径或者运行测试工程的根路径log4j.appender.logfile.File=pss.loglog4j.appender.logfile.MaxFileSize=512KB# Keep three backup files.log4j.appender.logfile.MaxBackupIndex=3# Pattern to output: date priority [category] - messagelog4j.appender.logfile.layout=org.apache.log4j.PatternLayoutlog4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n

配置完成后,再次执行,得到结果不同了,没有Warning了

2017-11-23 11:08:04,354 INFO [org.springframework.context.support.ClassPath]; root of context hierarchy2017-11-23 11:08:04,693 INFO [org.springframework.beans.factory.class path resource [aop.'s before()...............This is AdviceBook's front()...............This is Book's fun()..............This is AdviceBook's end()...............This is AdviceBook's after()...............

日志级别看更详细信息可以用debug,显示会更细致。

 

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:Spring框架 (log4j :WARN No appenders could be found for logger log4j:WARN Please initialize the log4j system properly.)问题解决

关键词:Spring

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录