Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 76771 invoked from network); 10 May 2004 08:56:45 -0000 Received: from unknown (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 May 2004 08:56:45 -0000 Received: (qmail 429 invoked by uid 500); 10 May 2004 08:56:49 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 157 invoked by uid 500); 10 May 2004 08:56:46 -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 141 invoked by uid 98); 10 May 2004 08:56:46 -0000 Received: from simon@ecnetwork.co.nz by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(202.135.116.201):. Processed in 0.20441 secs); 10 May 2004 08:56:46 -0000 X-Qmail-Scanner-Mail-From: simon@ecnetwork.co.nz via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(202.135.116.201):. Processed in 0.20441 secs) Received: from unknown (HELO unxcoms01.ecnetwork.co.nz) (202.135.116.201) by hermes.apache.org with SMTP; 10 May 2004 08:56:45 -0000 Received: from serpent.ecnetwork.co.nz (serpent [202.135.190.10]) by unxcoms01.ecnetwork.co.nz (8.12.8/8.12.8) with ESMTP id i4A8uGXL019629 for ; Mon, 10 May 2004 20:56:16 +1200 Received: from pcjohns.ecnnz.ecnetwork.co.nz (unknown [202.135.190.30]) by serpent.ecnetwork.co.nz (Postfix) with ESMTP id D3F001035 for ; Mon, 10 May 2004 21:04:03 +1200 (NZST) Subject: Re: [logging] How to get logging to use new Monolog subclass From: Simon Kitching To: Jakarta Commons Users List In-Reply-To: <001901c43667$e4395330$1700a8c0@talicnitom> References: <005e01c43664$8c926390$1700a8c0@talicnitom> <1084176662.5614.136.camel@pcsimon> <001901c43667$e4395330$1700a8c0@talicnitom> Content-Type: text/plain Message-Id: <1084179375.5443.174.camel@pcsimon> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 10 May 2004 20:56:16 +1200 Content-Transfer-Encoding: 7bit X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote: > Hollowing Simon's suggestion, I am posting the same question under another > Subject. > > And to be more specific: I am working tiwht Monolog logger that implements > and extends log4j functionality. I needed a new Log impl. in commons logging > to be able to use Monolog logger with tomcat. > Hopefully this clears it up. And here's the first post: > > I've working with commons logging for the past week and have implemented a > new logger within for my needs. > Now, since I am not confortable with the whole commons package yet and the > user's guide doesn't help much, could anyone explain me step by step how to > set-up my system to use the new logger? Cool, I'll have to look into monolog a bit. As Jose mentioned, you can just set a system property on the jvm command line: java -Dorg.apache.commons.logging.Log=your.log.class (described in the LogFactoryImpl javadoc) This is fine for debugging, but isn't very nice when building frameworks, etc. But from a quick peek at the code, it looks like you can also create a file "commons-logging.properties" and put it in the classpath, with these contents: org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl org.apache.commons.logging.Log=your.log.class And as a third option, it looks like you could define your own LogFactory subclass, and then specify it by creating a file: META-INF/services/org.apache.commons.logging.LogFactory with its first line being: your.logfactory.class I've only used the -D approach myself, so the above might be wrong. As always, the source code is the official and final documentation! The LogFactory and LogFactoryImpl classes are the ones that control all this behaviour. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org