2

I am using JBoss EAP6.0 with SLF4J as my logging facade and jboss logmanager as the backend logging implementation. Logging statements are being displayed but I cannot get a list of configured loggers using the org.jboss.logmanager or using the PlatformLoggingMXBean. Both lists are empty.

Here is my code:

Enumeration<String> loggerNames = LogManager.getLogManager().getLoggerNames();
while(loggerNames.hasMoreElements()){
     System.out.println("lm logger names: " + loggerNames.nextElement());
}

PlatformLoggingMXBean loggingMxBean = ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class);
List<String> loggerNames = loggingMxBean.getLoggerNames();
for(String logger : loggerNames) {
    System.out.println(logger);
}
  • One note jboss-logmanager doesn't support `LogManager.getLogManager().getLoggerNames()`. What JDK version are you using? Also, just pure curiosity, why do you want to list them? – James R. Perkins Oct 04 '13 at 22:14
  • On a second look I guess that's a stupid question since you're using the `PlatformLoggingMXBean`. There is a JIRA to add support for that https://issues.jboss.org/browse/WFLY-1279. – James R. Perkins Oct 04 '13 at 22:18

0 Answers0