Can I use LogBack inside an application deployed on JBoss EAP

Solution Verified - Updated -

Issue

  • We are trying to set up logging for our application using Logback. We are trying to do this by using SLF4J to route all the logs to Logback. However, JBoss seems to have its own version of SLF4J to route logging to JBoss LogManager (which extends java.util.logging). One of our application dependencies uses java.util.logging, and JBoss has a jul-to-slf4j stub. How can we make it work?
  • The slf4j-simple not found in provided eap maven repository.
  • While updating our EAP installation from version 6.2 to 6.3, the version of "org.slf4j" was updated in "jboss-as-parent-7.4.0.Final-redhat-19.pom" file. The update was from "1.7.2.redhat-2" to "1.7.2.redhat-3". The version "1.7.2.redhat-3" doesn't exist for the "slf4j-simple" JAR File, which we use. The eap maven repository doesn't contain it. Can you please provide this JAR file? Or should we use provided JAR in version "1.7.2.redhat-2"?
  • We are receiving an error message "LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation". How can we correct this?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content