我有很多 Web 应用程序要构建/打包,我想分享他们的公共库。
关于日志记录,我想将 slf4j-api 与每个应用程序捆绑在一起,但考虑我的容器(目前是 tomcat)提供的实现
为此,我将 logback-classic 和 logback-core 这两个 jar 复制到 $CATALINA\lib 目录中。
不幸的是,在运行时,slf4j 与其实现之间的绑定失败并显示以下错误消息:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
我设法使其工作的唯一方法是将jar捆绑在war文件中。
有任何想法吗?