禁用 Struts2 日志 [英] Disable Struts2 logs

查看:43
本文介绍了禁用 Struts2 日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用 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 能够为不同的包设置不同的日志级别,因此使用日志关闭级别,我们可以禁用特定包的日志记录.

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
  • 自由标记
  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆