Websphere 应用程序调试日志记录
我正在尝试将我的 Web 应用程序部署在 Websphere 6.1 上以显示调试级别日志。
最初我使用的是 log4j,但已将所有记录器更改为使用公共日志记录,因为 Websphere 似乎支持这一点。
我已在“日志记录和跟踪”>“日志记录和跟踪”下设置了日志级别。服务器1>将日志详细级别更改为:
*=info: com.myapplication.*=all
不幸的是,这似乎只在 SystemOut.log 中显示我的应用程序的信息级别日志
以下内容显示在日志中:
if (log.isInfoEnabled())
log.info("End( messages[" + listMessages.size() + "] )");
但以下内容(来自相同的方法)没有:
if (log.isDebugEnabled())
log.debug("Start()");
我没有添加任何日志配置当我读到这是由 Websphere 设置时,我将文件添加到我的 war 中。
有谁知道如何在 Websphere 中使日志记录正常工作?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了回答我自己的问题,经过一个小时的观察,似乎调试和较低的公共日志记录被放入了trace.log 文件中。
信息日志放置在 SystemOut.log 文件中。
我预计调试也会转到 SystemOut.log 文件,这就是造成混乱的原因。
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.
它看起来像 WAS 6.1
finest
相当于debug
,所以我可以这样设置:It looks like in WAS 6.1
finest
is equivalent todebug
, so I could set it like so: