Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 10672 invoked from network); 1 Jun 2003 23:20:39 -0000 Received: from ms-smtp-02.texas.rr.com (24.93.36.230) by daedalus.apache.org with SMTP; 1 Jun 2003 23:20:39 -0000 Received: from angel (cs6669214-29.austin.rr.com [66.69.214.29]) by ms-smtp-02.texas.rr.com (8.12.5/8.12.2) with ESMTP id h51NKkfB016100 for ; Sun, 1 Jun 2003 18:20:47 -0500 (CDT) Received: from achim by angel with local (Exim 3.35 #1 (Debian)) id 19McDW-0004qx-00 for ; Sun, 01 Jun 2003 18:26:22 -0500 Date: Sun, 1 Jun 2003 18:26:22 -0500 To: Jakarta Commons Users List Subject: Re: [logging] LogConfigurationException Message-ID: <20030601232622.GA18607@austin.rr.com> References: <3EDA4913.30134.512CC7@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EDA4913.30134.512CC7@localhost> User-Agent: Mutt/1.3.28i From: Achim Felber X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Andreas, I think you need to configure Log4J yourself. At the very least you need to tell it where to find the log4j.properties file for instance by setting the log4j.configuration system property. I could be wrong but, I think commons-logging is supposed to only provide a generic interface for the actual logging calls. The configuration of the underlying logging package doesn't seem to be within the scope of commons-logging. So, when you change the actual logger, for instance convert from Log4J to the JDK1.4 logger you don't have to change every class, only the one which configures the logger. Your actual application code stays the same. Hope this helps, Achim On Sun, Jun 01, 2003 at 06:42:27PM +0200, Andreas Probst wrote: > Hi all, > > I'm trying to use commons-logging together with log4j. > > Do I have to initialise log4j, i.e. load the log4j.properties? I > don't think so. If I have to configure it myself, I'm tied to > log4j. Then I could use it directly. > > At the moment I get > > Caused by: org.apache.commons.logging.LogConfigurationException: > org.apache.commons.logging.LogConfigurationException: > org.apache.commons.logging.LogConfigurationException: Class o > g.apache.commons.logging.impl.Log4JLogger does not implement Log > at > org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFac > toryImpl.java:532) > at > org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFac > toryImpl.java:272) > at > org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFac > toryImpl.java:246) > at > org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395) > > I put the following code into my class: > > import org.apache.commons.logging.Log; > import org.apache.commons.logging.LogFactory; > static Log logger = LogFactory.getLog(AllTests.class); > > Isn't this enough? > > >From reading the source code I think log4j.jar has to be in > classpath. Right? > > Thanks in advance for your help > > Andreas > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >