Version 4

    Tracing System.out.println and System.err.println

     

    Note: This article only applies to JBossAS 4.x and 5.x.

     

    Occasionally calls to System.out.println and System.err.println slip through and become visible in the logging output, the logging category for this calls is STDOUT and STDERR so it is not as easy to trace where the actual message originated from.

     

    The following system property can be set to also include a Throwable in the message logged to trace where the message originated from: -

     

      -Dorg.jboss.logging.util.LoggerStream.trace=true

     

    This causes messages to be logged in the following format: -

     

    12:06:36,901 INFO  STDOUT no object for dependsType  java.lang.Throwable       at org.jboss.logging.util.LoggerStream.write(LoggerStream.java:148)       at org.jboss.logging.util.LoggerStream.println(LoggerStream.java:93)       at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bindComplexType(XsdBinder.java:855)

     

    From this we can now see that these messages during JBoss start-up originate from the org.jboss.xb.binding.sunday.unmarshalling.XsdBinder class.

     

    Please note that this is only available if Log4j has been initialised by the Log4jService, by default this is not available.