1 Reply Latest reply on Oct 7, 2013 7:53 PM by jamezp

    How do I get a list of configured loggers using Jboss LogManager with SLF4J?

    kfromme

      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.getLogge@rNames();
      for(String logger : loggerNames) {
        System.out.println(logger);
      }