logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r833805 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
Date Sun, 08 Nov 2009 02:13:45 GMT
Author: sdeboy
Date: Sun Nov  8 02:13:45 2009
New Revision: 833805

URL: http://svn.apache.org/viewvc?rev=833805&view=rev
Log:
route httpclient logging to the chainsaw-log tab (vfslogfilepatternreceiver with an http file
system uses httpclient)

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java?rev=833805&r1=833804&r2=833805&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java Sun Nov  8 02:13:45
2009
@@ -354,6 +354,20 @@
     Logger.getLogger("org.apache").removeAllAppenders();
     Logger.getLogger("org.apache").addAppender(rewriteAppender);
     Logger.getLogger("org.apache").setAdditivity(false);
+
+    //commons-vfs uses httpclient for http filesystem support, route this to the chainsaw-log
tab as well
+    appenders = Logger.getLogger("httpclient").getAllAppenders();
+    if (!appenders.hasMoreElements()) {
+        appenders = Logger.getRootLogger().getAllAppenders();
+    }
+    while (appenders.hasMoreElements()) {
+        Appender nextAppender = (Appender)appenders.nextElement();
+        rewriteAppender.addAppender(nextAppender);
+    }
+    Logger.getLogger("httpclient").removeAllAppenders();
+    Logger.getLogger("httpclient").addAppender(rewriteAppender);
+    Logger.getLogger("httpclient").setAdditivity(false);
+
     //set the commons.vfs.cache logger to info, since it can contain password information
     Logger.getLogger("org.apache.commons.vfs.cache").setLevel(Level.INFO);
     



Mime
View raw message