与glassfish slf4j忽略logback [英] slf4j with glassfish is ignoring logback
问题描述
删除此工件会导致日志记录按预期工作,但由于此问题中描述的java-ee api问题导致测试失败 - 。
我相信导致问题的确切的pom条目是:
< dependency>
< groupId> org.glassfish.extras< / groupId>
< artifactId> glassfish-embedded-all< / artifactId>
< version> 3.1< / version>
< scope> test< / scope>
< /依赖关系>
有没有办法配置slf4j来使用logback?或者是否有更好的方法来测试java ee代码?
Glassfish Server包含一个SLF4J Binding实现,它也被加载。
如果你用eg打开glassfish jar 7zip你看到有一个org / slf4j / impl / StaticLoggerBinder.class。
在我看来,他们已经为JDK14Logging实现了自己的日志绑定。其他人知道如何禁用此绑定?
另请参阅此链接:使用EJB3.1进行logback
In a java-ee maven project I have I'm wanting to use slf4j with logback, however I believe inclusion of the 'glassfish-embedded-all' artifact from org.glassfish.extras is causing the JDK14LoggerAdapter to be used instead.
Removing this artifact causes the logging to work as expected, however causes test failures due to java-ee api issues as described on this question - Testing against Java EE 6 API.
The exact pom entry causing the problem, I believe, is:
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>
Is there a way to configure slf4j to use logback? Or is there a better way of testing java ee code?
The Glassfish Server includes an SLF4J Binding implementation which is also loaded.
If you open the glassfish jar with e.g. 7zip you see there is a org/slf4j/impl/StaticLoggerBinder.class.
In my point of view they have implemented their own logging binder for JDK14Logging. Does anyone else know how to disable this Binding?
Also see this link: logback with EJB3.1
这篇关于与glassfish slf4j忽略logback的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!