ERROR StatusLogger No log4j2 configuration file found. 找不到日志配置文件
2016-10-15 15:25
519 查看
在使用Struts2的时候启动Tomcat出现的错误,ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
原因:Maven dependencies are magic. Are you running Maven Java Project and using log4j into your project? Have you added below to your project’s pom.xml file? Probably the easiest way to get logging into your java application is with log4j from Apache.
我们在使用Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具。当我们需要运行Maven 关联项目和需要在你的项目下使用log4j的时候你需要在自己的项目下的源文件src下创建一个xml文件进行配置让你的项目能够正常的进行运行.
配置log4j2.xml文件如下:
配置完成后进行从启项目,就可以正常的运行了.
原因:Maven dependencies are magic. Are you running Maven Java Project and using log4j into your project? Have you added below to your project’s pom.xml file? Probably the easiest way to get logging into your java application is with log4j from Apache.
我们在使用Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具。当我们需要运行Maven 关联项目和需要在你的项目下使用log4j的时候你需要在自己的项目下的源文件src下创建一个xml文件进行配置让你的项目能够正常的进行运行.
配置log4j2.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss} [%t] %-5p %c{1}:%L - %msg%n" /> </Console> <RollingFile name="RollingFile" filename="log/ZycTest.log" filepattern="${logPath}/%d{YYYYMMddHHmmss}-fargo.log"> <PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss} [%t] %-5p %c{1}:%L - %msg%n" /> <Policies> <SizeBasedTriggeringPolicy size="100 MB" /> </Policies> <DefaultRolloverStrategy< 4000 /span> max="20" /> </RollingFile> </Appenders> <Loggers> <Root level="info"> <AppenderRef ref="Console" /> <AppenderRef ref="RollingFile" /> </Root> </Loggers> </Configuration>
配置完成后进行从启项目,就可以正常的运行了.
相关文章推荐
- Struts2.5 ERROR StatusLogger No log4j2 configuration file found. Using default configurati
- 关于ERROR StatusLogger No log4j2 configuration file found. 解决 eclipse报错
- 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.
- ERROR StatusLogger No log4j2 configuration file found.的解决方法
- Struts2 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging
- SSH Exception 2017.3.27-3 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 found. Using default configuration: logging only err
- Log4J配置后, log4j:ERROR setFile(null,true) call failed. 报错:java.io.FileNotFoundException: /log/mytest2.log (系统找不到指定的路径。)
- Java项目读取配置文件时,FileNotFoundException 系统找不到指定的文件,System.getProperty("user.dir")的理解
- Error:java.io.FileNotFoundException: 系统找不到指定的文件.
- META-INF/spring.factories中找不到自动配置类,No auto configuration classes found in META-INF/spring.factories.
- 编译C++,找不到头文件(fatal error: string: No such file or directory)
- 测试中出现ERROR StatusLogger No log4j2 configuration file
- emulator: ERROR: no search paths found in this AVD's configuration. Weird, the AVD's config.ini file
- Hive 查询报错:No log4j2 configuration file found. Using default configuration: logging only errors to th
- ndk编译C++,提示找不到头文件(ndk-build error string No such file or directory)