Websphere多个slf4j logback绑定可以解决 [英] Websphere Multiple slf4j logback bindings work around

查看:160
本文介绍了Websphere多个slf4j logback绑定可以解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Websphere v8.5.5.0上运行一个应用程序,并尝试使用logback作为我的日志框架。

I am running an application on Websphere v8.5.5.0 and am attempting to use logback as my logging framework.

当我尝试启动应用程序时,我我遇到类似于这一个的错误:

When i try to start the application, I am greeted with an error similar to this one:

[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: Class path contains multiple SLF4J bindings.
[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: Found binding in [bundleresource://266.fwk1755217229:1/org/slf4j/impl/StaticLoggerBinder.class]
[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: Found binding in    [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer_1/profiles/AppSrv01/installedApps/AUSSYDCVTLJ007Node02Cell/myapp.ear/lib/logback-classic-1.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[10/03/14 13:19:01:313 EST] 00000097 SystemErr     R   SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

正如答案所解释的那样, ibm库已经包含了类路径上的logback-classic库的实现。我希望及时了解最新的logback,所以想知道是否有人可以告诉我如何手动选择要使用的绑定(而不使用父级最后的类加载器!)。

As the answer explains, The ibm libraries contain an implementation of the logback-classic library on the classpath already. I want to stay up to date with the latest logback so was wondering whether someone could show me how to manually choose the binding to use (without using a parent-last classloader!).

推荐答案

实际上,您在案例中看到的错误消息是IBM WebSphere Application Server v8.5.5.0的已知错误。问题是WAS在内部使用的是SLF4j,但是这个实现应该是来自应用程序的未知(并且不可用)。不幸的是,您看到的这些错误消息并未被WAS框架阻止,但您可以忽略它们(除非您没有很好地使用SLF4j)。
好​​消息是此问题已在FixPack 3(WAS 8.5.5.3)中修复。
该错误在此处由IBM支持引用。因此,请更新您的WAS安装。如果在应用修复程序后仍然出现错误消息,则可能需要检查SLF4J配置和使用情况。

Actually the error messages you see in your case is a known bug of IBM WebSphere Application Server v8.5.5.0. The issue is that WAS is using is SLF4j internally but this implementation is supposed to be unknown (and unusable) from applications. Unfortunately, these error messages you see have not been blocked by the WAS framework but you can ignore them (except if you have not well used SLF4j). The good news is that this issue has been fixed in FixPack 3 (WAS 8.5.5.3). The bug is referenced by IBM Support here. So, update your WAS installation. If, after applying the fix, the error messages still occur, then, you probably have to review your SLF4J configuration and usage.

John

这篇关于Websphere多个slf4j logback绑定可以解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆