问题描述
我正在尝试将我的Web应用程序部署在WebSphere 6.1上以显示调试级别日志.
最初我正在使用log4j,但已更改了所有记录仪以使用Commons Loggging,因为这似乎是WebSphere的支持.
我已经在记录和跟踪下设置了日志级别> server1>将日志详细级别更改为:
*=info: com.myapplication.*=all
不幸的是,这似乎只能显示我在systemout.log
的应用程序中的信息级别日志以下显示在日志中:
if (log.isInfoEnabled()) log.info("End( messages[" + listMessages.size() + "] )");
,但以下(来自同一方法)没有:
if (log.isDebugEnabled()) log.debug("Start()");
我没有在Wears Websphere设置的情况下向战争中添加任何日志配置文件.
有人知道如何在WebSphere中正确工作吗?
推荐答案
回答我自己的问题,环顾了一个小时后,似乎调试和较低的Commons Logging放在Trace.log文件中.
信息日志放在systemout.log文件中.
我也期望调试也可以转到systemout.log文件,这就是引起混乱的原因.
其他推荐答案
看起来像是6.1 finest finest等于debug,所以我可以将其设置为:
*=finest: com.myapplication.*=all
问题描述
I am trying to get my web application deployed on Websphere 6.1 to display debug level logs.
Originally I was using log4j, but have changed all loggers to use commons logging since it seems this is supported by Websphere.
I have set the log level under Logging and Tracing > server1 > Change Log Detail Levels to:
*=info: com.myapplication.*=all
Unfortunately this only seems to display info level logs from my application in the SystemOut.log
The following shows up in the logs:
if (log.isInfoEnabled()) log.info("End( messages[" + listMessages.size() + "] )");
But the following (from the same method) does not:
if (log.isDebugEnabled()) log.debug("Start()");
I have not added any log config files to my war as I read that this was set up by Websphere.
Does anyone know how to get logging working correctly in Websphere?
推荐答案
To answer my own question, after looking around for an hour, it appears that debug and lower from commons logging are placed into the trace.log file.
Info logs are placed into the SystemOut.log file.
I was expecting debug to go to the SystemOut.log file as well, this is what was causing the confusion.
其他推荐答案
It looks like in WAS 6.1 finest is equivalent to debug, so I could set it like so:
*=finest: com.myapplication.*=all