User: janb Date: 02/02/21 21:15:40 Modified: jetty/src/main/org/jboss/jetty/log JBossLogSink.java Log: Don't necessarily use just _log.debug() for Jetty debug: Jetty guards it's debug output to it's log sinks, so it will only get here if Jetty has debugging enabled. However, enabling debugging in Jetty (eg via the CodeMBean) may not result in log output because JBoss has it's log level set to INFO.To reduce confusion, if Jetty debug is enabled, but not on JBoss, we will still output it to the JBoss log sink as category INFO. Revision Changes Path 1.2 +24 -4 contrib/jetty/src/main/org/jboss/jetty/log/JBossLogSink.java Index: JBossLogSink.java =================================================================== RCS file: /cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/log/JBossLogSink.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JBossLogSink.java 13 Jan 2002 13:26:45 -0000 1.1 +++ JBossLogSink.java 22 Feb 2002 05:15:40 -0000 1.2 @@ -5,7 +5,7 @@ * See terms of license at gnu.org. */ -// $Id: JBossLogSink.java,v 1.1 2002/01/13 13:26:45 jules_gosnell Exp $ +// $Id: JBossLogSink.java,v 1.2 2002/02/22 05:15:40 janb Exp $ package org.jboss.jetty.log; @@ -26,7 +26,7 @@ * This class bidges the API between Jetty and Log4J. * * @author <a href="mailto:">Jules Gosnell</a> - * @version $Id: JBossLogSink.java,v 1.1 2002/01/13 13:26:45 jules_gosnell Exp $ + * @version $Id: JBossLogSink.java,v 1.2 2002/02/22 05:15:40 janb Exp $ * @since 1.0 * @see org.mortbay.util.LogSink */ @@ -42,8 +42,28 @@ public JBossLogSink() { - // populate the dispatch map... - _dispatch.put(Log.DEBUG, new MyLogger(){public void log(String s){_log.debug(s);}}); + // populate the dispatch map... + + // don't necessarily use just _log.debug() for Jetty debug: + // Jetty guards it's debug output to it's log sinks, so it will + // only get here if Jetty has debugging enabled. However, + // enabling debugging in Jetty (eg via the CodeMBean) may not + // result in log output because JBoss has it's log level set to + // INFO.To reduce confusion, if Jetty debug is enabled, but not + // on JBoss, we will still output it to the JBoss log sink as + // category INFO. + + _dispatch.put(Log.DEBUG, + new MyLogger() + { + public void log(String s) + { + if (_log.isDebugEnabled()) + _log.debug(s); + else + _log.info("DEBUG: "+s); + } + }); _dispatch.put(Log.EVENT, new MyLogger(){public void log(String s){_log.info(s);}}); _dispatch.put(Log.WARN, new MyLogger(){public void log(String s){_log.warn("WARNING: "+s);}}); _dispatch.put(Log.ASSERT, new MyLogger(){public void log(String s){_log.error(s);}});
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development