java - 框架内部日志转到 system.out (websphere 7.0)

标签 java logging configuration log4j websphere

我在应用程序中使用 Log4j,并且应用程序日志记录工作正常,而我应用程序中的框架在内部使用 commons-logging 并且日志将发送到 System.out 但我想将它们重定向到一个单独的文件,并且还想启用 DEBUG 级别。

在tomcat上测试过,工作正常。在各自的文件中生成所有日志。但是当我在 WAS7.0 上部署代码时,仅生成 INFO 级别的框架日志 SystemOut.log。 (我的 log4j.xml 很好,因为它在 tomcat 上运行良好)

如有任何帮助,我们将不胜感激。谢谢!

最佳答案

我也遇到了同样的问题。我在 Websphere Docs 中找到了答案。

Note: Trace information, which includes events at the Fine, Finer and Finest levels, can be written only to the trace log. Therefore, if you do not enable diagnostic trace, setting the log detail level to Fine, Finer, or Finest does not effect the logged data.

引用:http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Frtrb_loglevels.html

在 Java Utility Logging 术语中 FINE = DEBUG,因此 DEBUG 级别及以下级别不会出现在 System.out 中,仅出现在 WAS 跟踪日志中。

关于java - 框架内部日志转到 system.out (websphere 7.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15128427/

相关文章:

java - 如何正确地将String转换为ArrayList?

c# - Java 和 C# 中 "primitive"、 "value type"、 "struct"、 "class"、 "wrap"的定义

linux - Apache访问日志自动设置权限

php - 安装 Cakephp 调试套件

asp.net-mvc - 网页:Version setting do?是什么意思

java - 如何使用 XML Modifier 保存不断更新并最终将输出保存为文件

java - JAVA 和 OPEN JDK 6 中的 cacerts 问题

linux - Bash:如何干净地记录 ssh/bash 输出的处理行?

java - 用于跟踪文档管理系统内文档状态的数据库

gitignore 按文件大小?