Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 1824 invoked from network); 1 Oct 2003 21:27:03 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Oct 2003 21:27:03 -0000 Received: (qmail 72906 invoked by uid 500); 1 Oct 2003 21:26:46 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 72793 invoked by uid 500); 1 Oct 2003 21:26:45 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 72773 invoked from network); 1 Oct 2003 21:26:45 -0000 Received: from unknown (HELO smtp.easystreet.com) (206.26.36.40) by daedalus.apache.org with SMTP; 1 Oct 2003 21:26:45 -0000 Received: from apache.org (dsl-208-161-106-6.dsl.easystreet.com [208.161.106.6]) by smtp.easystreet.com (Postfix) with ESMTP id 8B09184531E for ; Wed, 1 Oct 2003 14:26:51 -0700 (PDT) Message-ID: <3F7B465B.1010805@apache.org> Date: Wed, 01 Oct 2003 14:25:47 -0700 From: "Craig R. McClanahan" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: DEBUG vs. TRACE under Log4JLogger References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Steve Cohen wrote: >In commons-logging-1.0.3, it seems that the package has been configured >so that if a commons-logging Log4JLogger is in use, TRACE is treated >exactly as if the code said DEBUG. This is true for isTraceEnabled() as >well. > >I may be remembering wrong, but I think I remember that in past versions >it didn't work that way. In a Log4JLogger isTraceEnabled simply >returned FALSE and TRACE logging statements did nothing. > > Log4J itself doesn't itself support the notion of trace-level debugging. Therefore, we chose to map Log.trace() to the nearest reasonable thing. >I actually have a use case where I would like commons-logging to >function that way. That use case is in JUnit testing where the JUnit >test runs under SimpleLogger, but when the application is deployed, it >uses log4j and I would like all the trace messages to be silent in that >case. > >However, this is not the way 1.0.3 works. Contrary to my >expressed-in-code wishes to have two separate levels, it promotes my >TRACE statements to be DEBUG statements. > > Doing what you suggest would be a really nasty surprise to people who developed their apps with trace level debugging (because JDK 1.4 or SimpleLog both support it) an then try to run that app with Log4J. All their trace level logs would disappear. Therefore, I'm -1 on doing what you propose in the standard release. >Is there some way to defeat this in commons-logging 1.0.3? I don't seem >to find one in the docs. I would like to have this "feature" be >configurable off. > > Nothing stops you from creating your own modified implementation of Log4JLogger that behaves the way you want, and set the right config property (org.apache.commons.logging.Log) so that your implementation gets picked up instead of the standard one. Craig --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org