title: LogManager Exception in JBOSS AS 7.1 with java.util.Logger
body: <p>I created a java application and initialize a java.util.Logger with that application and run that application as <code>-javaagent</code> with jboss AS 7 server and i got <code>IllegalStateException</code> (i am using eclipse IDE).Here follows my logger initialization code</p>
  
  <pre>
  <code>
  static public void setup() throws IOException {
  
          // Get the global logger to configure it
          Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
  
          logger.setLevel(Level.INFO);
          fileTxt = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.txt");
          fileHTML = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.html");
  
          // create txt Formatter
          formatterTxt = new SimpleFormatter();
          fileTxt.setFormatter(formatterTxt);
          logger.addHandler(fileTxt);
  
          // create HTML Formatter
          formatterHTML = new BMITHtmlFormatter();
          fileHTML.setFormatter(formatterHTML);
          logger.addHandler(fileHTML);
        }
  </code>
  </pre>
  
  <p>When i create <code>-javaagent</code> jar appended with above lines of code and run with jboss as7 server i got following exception</p>
  
  <pre>
  <code>
  WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
  Exception in thread "main" java.lang.ExceptionInInitializerError
      at org.jboss.as.server.Main.main(Main.java:73)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.modules.Module.run(Module.java:260)
      at org.jboss.modules.Main.main(Main.java:291)
  Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
      at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
      at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
      ... 7 more
  </code>
  </pre>
  
  <p>And i serched in fourms and i got a <a href="https://community.jboss.org/thread/195016?tstart=0" rel="noreferrer">solution</a> which is Open the launch configuration for the server definition.
  and add <code>-logmodule org.jboss.logmanager</code> to the program arguments before <code>org.jboss.as.standalone</code>.
  But it results the same exception with some additional warning. Here follows the exception</p>
  
  <pre>
  <code>
  WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.
  WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
  Exception in thread "main" java.lang.ExceptionInInitializerError
      at org.jboss.as.server.Main.main(Main.java:73)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.modules.Module.run(Module.java:260)
      at org.jboss.modules.Main.main(Main.java:291)
  Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
      at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
      at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
      ... 7 more
  </code>
  </pre>