Struts2.5 ERROR StatusLogger No log4j2 configuration file found. Using default configurati
来源:互联网 发布:上海火速网络 编辑:程序博客网 时间:2024/05/21 08:53
Struts2 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging
Struts2错误StatusLogger没有发现log4j2配置文件。使用默认配置:日志记录
解决办法:
参考官方给的示例:C:\Users\lzhpc\Desktop\Struts2.5.5\struts-2.5.5-all\struts-2.5.5\apps\struts2-rest-showcase\WEB-INF\src\java
在项目的"src"(官方示例是在java包下)下,新建一个log4j2.xml,内容如下:
<?xml version="1.0" encoding="UTF-8"?><Configuration> <Appenders> <Console name="STDOUT" target="SYSTEM_OUT"> <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> </Console> </Appenders> <Loggers> <Logger name="com.opensymphony.xwork2" level="info"/> <Logger name="org.apache.struts2" level="info"/> <Logger name="org.demo.rest" level="debug"/> <Root level="warn"> <AppenderRef ref="STDOUT"/> </Root> </Loggers></Configuration>
从网上搜索别人的代码如下:
<?xml version="1.0" encoding="UTF-8"?><Configuration> <Appenders> <Console name="STDOUT" target="SYSTEM_OUT"> <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> </Console> <RollingFile name="RollingFile" fileName="logs/strutslog1.log" filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz"> <PatternLayout> <Pattern>%d{MM-dd-yyyy} %p %c{1.} [%t] -%M-%L- %m%n</Pattern> </PatternLayout> <Policies> <TimeBasedTriggeringPolicy /> <SizeBasedTriggeringPolicy size="1 KB"/> </Policies> <DefaultRolloverStrategy fileIndex="max" max="2"/> </RollingFile> </Appenders> <Loggers> <Logger name="com.opensymphony.xwork2" level="WAN"/> <Logger name="org.apache.struts2" level="WAN"/> <Root level="warn"> <AppenderRef ref="STDOUT"/> </Root> </Loggers></Configuration>
这样配置后,启动时就不会在出现异常了。
0 0
- Struts2.5 ERROR StatusLogger No log4j2 configuration file found. Using default configurati
- Struts2 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging
- ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only err
- ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only err
- ERROR StatusLogger No log4j2 configuration file found.的解决方法
- ERROR StatusLogger No log4j2 configuration file found. 找不到日志配置文件
- SSH Exception 2017.3.27-3 ERROR StatusLogger No log4j2 configuration file found
- 测试中出现ERROR StatusLogger No log4j2 configuration file
- Hive 查询报错:No log4j2 configuration file found. Using default configuration: logging only errors to th
- Error:Configuration with name 'default' not found.
- Error:Configuration with name 'default' not found.
- Error:Configuration with name 'default' not found.
- Error:Configuration with name 'default' not found.
- Error:Configuration with name 'default' not found.
- Jenkins ERROR: No artifacts found that match the file pattern "build/*/*.ipa". Configuration error
- ERROR StatusLogger Log4j2 could not find a logging implementation.
- no default or UI configuration directive found boot:
- no default or UI configuration directive found问题解决
- 链表的增删改查
- 802.11协议精读16:信道模型(SISO)以及Break Point距离
- JAVA/Android 笔记 定时/循环任务以及动画(Animator)
- Leetcode 152. Maximum Product Subarray
- PHP--预定义超全局变量
- Struts2.5 ERROR StatusLogger No log4j2 configuration file found. Using default configurati
- PHP---防止注入攻击
- 【30.36%】【codeforces 740D】Alyona and a tree
- Struts2.5-add log4j-core to the classpath
- PHP--model1模式、分层模式、mvc模式:
- 早上好
- Maven的继承和聚合
- Generative adversarial nets 论文笔记
- 类和对象的区别