我在应用程序中使用 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.
在 Java Utility Logging 术语中 FINE = DEBUG,因此 DEBUG 级别及以下级别不会出现在 System.out 中,仅出现在 WAS 跟踪日志中。
关于java - 框架内部日志转到 system.out (websphere 7.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15128427/