Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 35653 invoked from network); 8 Feb 2005 11:29:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Feb 2005 11:29:41 -0000 Received: (qmail 16867 invoked by uid 500); 8 Feb 2005 11:29:39 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 16795 invoked by uid 500); 8 Feb 2005 11:29:38 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 16774 invoked by uid 99); 8 Feb 2005 11:29:38 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from gulcu002.worldcom.ch (HELO mail.qos.ch) (212.74.184.210) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 08 Feb 2005 03:29:37 -0800 Received: from kal.qos.ch (kal [192.168.1.3]) by mail.qos.ch (Postfix) with ESMTP id 1DC451EC078 for ; Tue, 8 Feb 2005 12:37:04 +0100 (CET) Message-Id: <6.0.3.0.0.20050208110617.03b392d8@mail.qos.ch> X-Sender: ceki@mail.qos.ch (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.3.0 Date: Tue, 08 Feb 2005 12:30:54 +0100 To: "Jakarta Commons Developers List" From: Ceki =?iso-8859-1?Q?G=FClc=FC?= Subject: Re: JCL problems In-Reply-To: References: <6.0.3.0.0.20050207201810.03afc4c0@mail.qos.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Richard et al., Before discussing relatively complex cases you mention, I think it would benefit everyone to realize that even in the most basic cases JCL will not work as expected. In your examples you refer to commons-logging-api.jar but commons-logging-api.jar and commons-logging.jar are not equivalent. The former does *not* include the classes org.apache.commons.logging.impl.Log4JLogger nor org.apache.commons.logging.impl.AvalonLogger. Thus, commons-logging-api.jar cannot bridge to log4j, for the simple reason that the bridge, Log4JLogger, is not there. Consider the following simple set up Parent [commons-logging.jar] ^ | Child [log4j.jar] Depending on how the thread context class loader is set,and the delegation model followed by the child loader, the above configuration, in the best case, will ignore log4j and in many other cases will throw a LogConfigurationException. The following set up will not fair much better (regardless of the delegation model): Parent [commons-logging.jar] ^ | Child [commons-logging.jar, log4j.jar] The only setup that will not blow in your face is the following: Parent [commons-logging-api.jar] ^ | Child [commons-logging.jar, log4j.jar] Note this is the set up used by Tomcat. Also note that it precludes the use of log4j by Tomcat itself as commons-logging-api.jar includes support for java.util.logging but not log4j. If you replace commons-logging-api.jar with commons-logging.jar, then you must place log4j.jar next to it unless you enjoy JCL throwing LogConfigurationExceptions at you. The bottom lines is that when compared with any statically bound bridging mechanism found in UGLI, JCL's dynamic discovery brings no added value but has a significant cost in aggravation. Richard, is there a point discussing complex cases when even the simplest ones don't work? Were you aware of problems in the above cases? At 09:52 PM 2/7/2005, Richard Sitze wrote: >One problem that we encounter, in one form or another, is when we look for >a resource that "may or may not" be visible. For example, a configuration >file. > >As delivered, the JCL jar files do *not* include a configuration file. > > Parent [commons-logging-api.jar, Log4J.jar] > ^ > | > Child > >This works as expected, for the most part [other ClassLoader problems >aside]. So how do you configure the child application, in this case, to >use a different logger? You might introduce a configuration file. > > Parent [commons-logging-api.jar, Log4J.jar] > ^ > | > Child [commons-logging.properties, LogKit.jar] [cut] --=20 Ceki G=FClc=FC The complete log4j manual: http://www.qos.ch/log4j/ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org