Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 4920 invoked from network); 15 Nov 2006 12:42:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2006 12:42:25 -0000 Received: (qmail 77570 invoked by uid 500); 15 Nov 2006 12:42:33 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 77239 invoked by uid 500); 15 Nov 2006 12:42:32 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 77228 invoked by uid 99); 15 Nov 2006 12:42:32 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of stauffer.james@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 04:42:30 -0800 Received: by ug-out-1314.google.com with SMTP id e2so109857ugf for ; Wed, 15 Nov 2006 04:40:15 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rNAO8GrlZis+6h/sAGubg3oKNRrZKfKA8mMDX5pA/CFG1FT6recQ24aXPUgiYd3ooOtdgq8isBxPmOILMlqSYjgc91wS0rmSB2Z1EEGUx50K6XGDcbeFpW6c9bWF3pWsLmnm3Jx+9X0TOkFyvJNTzCk+TzUfx3/IlcUgHzq05ts= Received: by 10.78.164.13 with SMTP id m13mr2208224hue.1163594414382; Wed, 15 Nov 2006 04:40:14 -0800 (PST) Received: by 10.78.202.9 with HTTP; Wed, 15 Nov 2006 04:40:14 -0800 (PST) Message-ID: Date: Wed, 15 Nov 2006 06:40:14 -0600 From: "James Stauffer" To: "Log4J Users List" Subject: Re: Extending log4j Logger In-Reply-To: <455ff8740611141417j480e6ae1lcf67bf229de57044@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <455ff8740611141201p2bc5d586t1f22edb0e599cc5f@mail.gmail.com> <455ff8740611141417j480e6ae1lcf67bf229de57044@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Generally extending Logger is a bad idea. Search the archives for more info. On 11/14/06, GoodOne wrote: > Greetings! > > I am trying to do this but logging agasint the object returned gives me > NullPointer exception. > > If I extend the Logger class and use proper constructor why shoudl it give > problem? If I use > return Logger.getLogger(name); instead of return new MyLogger(name); > it works fine. > > > public final class MyLogger extends Logger{ > > protected MyLogger(String name){ > super(name); > } > > public static org.apache.log4j.Logger getLoggerInstance(String name){ > return new MyLogger(name); > } > } > > Thank you. > The Good One. > > > > > On 11/14/06, GoodOne wrote: > > > > Greetings! > > I am trying to extend log4j Logger, something like class A subclassing > > Logger. I would like to have an instance of class A returned than log4j > > Logger's instance. > > Any idea? > > Thank you, > > The Good One. > > > > -- James Stauffer http://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org