禁用Struts2日志 [英] Disable Struts2 logs
问题描述
如何禁用Struts2数以百万计的日志?
How can I disable Struts2 zillions of logs?
我经常收到这样的日志:
I constantly get logs like this:
2012-04-12 23:20:31,487 DEBUG [XWorkConverter.java:388] : Property: menuExpandedOps
我正在使用struts 2.0和标准的Java日志记录(我没有在使用log4j).
I'm using struts 2.0 and standard java logging (I'm not using log4j).
JVM的logging.properties文件默认设置为INFO,并且我的 struts.properties
文件中已经有 struts.devMode = false
.>
The logging.properties file of the JVM is set by default to INFO, and I already have struts.devMode = false
in my struts.properties
file.
推荐答案
如果您可以自由使用log4j,我建议您使用它,因为Log4j可以为不同的软件包设置不同的日志级别,因此可以使用日志级别OFF,我们可以禁用特定程序包的日志记录.
If you are free to use log4j, i suggest you to use that, since Log4j has the ability to set different log levels for different packages and hence using the log level OFF we can disable logging for a particular package.
在S2中,大多数日志消息将来自这些软件包
In S2 most of the log messages will be from these packages
- xwork2
- struts2
- freemarker
- ognl
和类路径中的简单属性文件/xml文件可以帮助您打开或关闭日志记录信息.
and a simple property file/xml file in class-path can help you to turn on or off the logging information.
这篇关于禁用Struts2日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!