【发布时间】:2014-03-10 06:36:37
【问题描述】:
我正在 Websphere v8.5.5.0 上运行一个应用程序,并尝试使用 logback 作为我的日志记录框架。
当我尝试启动应用程序时,收到类似于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]
正如answer 解释的那样,ibm 库已经在类路径上包含了 logback-classic 库的实现。我想了解最新的 logback,所以想知道是否有人可以告诉我如何手动选择要使用的绑定(不使用 parent-last 类加载器!)。
【问题讨论】:
标签: java websphere slf4j logback