Skip to content

Commit

Permalink
JBLOGGING-70 - we can only use the logmanager backend if the class we…
Browse files Browse the repository at this point in the history
… see is equal to the class that was installed (i.e. do not fail in the event of a duplicate logmanager JAR)
  • Loading branch information
dmlloyd committed Nov 16, 2011
1 parent ab94040 commit 787577b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/jboss/logging/LoggerProviders.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ private static LoggerProvider tryLog4j(final ClassLoader cl) throws ClassNotFoun
}

private static LoggerProvider tryJBossLogManager(final ClassLoader cl) throws ClassNotFoundException {
final LogManager jdkLogManager = LogManager.getLogManager();
if (jdkLogManager.getClass().getName().equals("org.jboss.logmanager.LogManager")) {
Class.forName("org.jboss.logmanager.Logger$AttachmentKey", false, cl);
if (LogManager.getLogManager().getClass() == Class.forName("org.jboss.logmanager.LogManager", false, cl)) {
Class.forName("org.jboss.logmanager.Logger$AttachmentKey", true, cl);
return new JBossLogManagerProvider();
}
throw new IllegalStateException();
Expand Down

0 comments on commit 787577b

Please sign in to comment.