2

我有一个奇怪的问题,即我的 log4j 日志记录在部署在 tcServer 上而不是在 WebSphere 6.1 上时有效。我在 log4j 中指定的文件名已创建。但是,即使其他 Websphere 日志(SystemOut.log 等)已填充,它也不会填充。我检查了我的 WebSphere 主目录的属性目录,并且那里没有冲突的 log4j 文件。

最奇怪的是它在 tcServer 上运行良好,所以它不会是 log4j 文件本身的问题。这似乎是一些环境问题。有没有人对如何解决这个问题有任何想法?

谢谢

4

2 回答 2

3

Log4j 和 WAS 已经为太多的应用程序工作了。所以这种组合无论如何都不新鲜。您是否使用任何 log4j 包装器(例如 Commons Logging)?

打开 log4j 的调试。

-Dlog4j.debug=true 到 WAS JVM 参数。

这将提供有关 log4j 尝试做什么的信息。

这应该为 WAS 环境中正在发生的事情提供一些线索。

高温高压

芒鲁

于 2011-09-01T23:48:21.203 回答
1

We had an issue a while back when we installed a JCA connector in WebSphere that came packaged with it's own log4j lib. Since connectors gets loaded into the container classloader hierarchy, the log4j lib in the connector effectively overrode the log4j in our application. It also prevented our own log4j properties from being loaded, since log4j was already bootstrapped.

It would be that you, also, have some other library or resource loaded in your WAS stack that comes with log4j. The way we got around it was doing explicit log4j initialization (reading the log4j properties) programatically in our application.

于 2011-09-02T11:03:30.020 回答