Websphere 应用程序调试日志记录

发布于 2024-09-11 03:48:07 字数 620 浏览 2 评论 0原文

我正在尝试将我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

世态炎凉 2024-09-18 03:48:07

为了回答我自己的问题,经过一个小时的观察,似乎调试和较低的公共日志记录被放入了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.

一口甜 2024-09-18 03:48:07

它看起来像 WAS 6.1 finest 相当于 debug,所以我可以这样设置:

*=finest: com.myapplication.*=all

It looks like in WAS 6.1 finest is equivalent to debug, so I could set it like so:

*=finest: com.myapplication.*=all
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文