You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bu...@apache.org on 2003/04/29 15:49:05 UTC

DO NOT REPLY [Bug 19426] New: - Logging cannot be turned off when Log4J is in classpath

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19426>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19426

Logging cannot be turned off when Log4J is in classpath

           Summary: Logging cannot be turned off when Log4J is in classpath
           Product: Commons
           Version: 2.0 Alpha 3
          Platform: PC
               URL: http://www.atobemobile.com
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HttpClient
        AssignedTo: commons-httpclient-dev@jakarta.apache.org
        ReportedBy: dejan.novakovic@atobemobile.com
                CC: dejan.novakovic@atobemobile.com


There is a problem turning off logging when Log4J is in the classpath. On the 
other hand, when Log4J (version 1.2.6) is not in the path the following line 
stops any logging from HttpClient:
  System.setProperty("org.apache.commons.logging.Log",
                     "org.apache.commons.logging.impl.NoOpLog");

Reading the API documentation about default implementation of LogFactory I see 
that Log4J is lower in the rules list for determining Log instance, so this 
seems to me like a bug.

We use Log4J logging framework ONLY indirectly, as an underlying implementation 
of our own error-handling framework, so we need to keep it in the path. At the 
same time, of course, all error handling we want to go through our framework, 
not through Log4J framework.