3 Replies Latest reply on Mar 17, 2008 5:08 AM by Ravisha TC

    Using java.util.logging.Logger to log messages in JBoss

    ajavadeveloper Newbie

      Got a question about using the Java API's logging framework and JBoss. I do the following:

      Logger logger = Logger.getLogger(getClass().getPackage().getName());
      logger.info("This is a test message.");

      In the JBoss's server log (and console) I get the following:

      11:11:08,813 ERROR [STDERR] Feb 3, 2004 11:11:08 AM TestBean setName
      INFO: This is a test message.

      Now, I'm happy that I get my log message printed to both the console and server.log file but why is it labeled as an ERROR [STDERR] message? I invoked the info() method from the logger? How do I get it to be labeled as an INFO (or whatever it should be) message on the first line of the output? It does label it as INFO on the second line however.

      Now if I instead use System.out.println() it is labeled as an INFO message and if I use System.err.println() it is labeled as an ERROR message in both the console and server.log.

      Thanks for any help!