Return-Path: Delivered-To: apmail-jakarta-log4j-user-archive@apache.org Received: (qmail 32876 invoked from network); 15 Aug 2003 07:38:57 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 15 Aug 2003 07:38:56 -0000 Received: (qmail 14919 invoked by uid 97); 15 Aug 2003 07:41:50 -0000 Delivered-To: qmlist-jakarta-archive-log4j-user@nagoya.betaversion.org Received: (qmail 14912 invoked from network); 15 Aug 2003 07:41:49 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 15 Aug 2003 07:41:49 -0000 Received: (qmail 32021 invoked by uid 500); 15 Aug 2003 07:38:44 -0000 Mailing-List: contact log4j-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@jakarta.apache.org Received: (qmail 31998 invoked from network); 15 Aug 2003 07:38:44 -0000 Received: from main.gmane.org (80.91.224.249) by daedalus.apache.org with SMTP; 15 Aug 2003 07:38:44 -0000 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19nZBv-0003Hq-00 for ; Fri, 15 Aug 2003 09:40:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: log4j-user@jakarta.apache.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19nZ1U-0003DR-00 for ; Fri, 15 Aug 2003 09:29:20 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19nZ0K-0002JY-00 for ; Fri, 15 Aug 2003 09:28:08 +0200 From: Eduardo Francos Subject: Re: discreet log types Date: Fri, 15 Aug 2003 09:28:08 +0200 Lines: 93 Message-ID: References: <5.2.0.9.0.20030814161238.00a27880@mail.dalmatian.com> <5.2.0.9.0.20030814144650.00a28040@mail.dalmatian.com> <5.2.0.9.0.20030730160046.00a281e0@mail.dalmatian.com> <5.2.0.9.0.20030814144650.00a28040@mail.dalmatian.com> <5.2.0.9.0.20030814161238.00a27880@mail.dalmatian.com> <5.2.0.9.0.20030814180141.00a34430@mail.dalmatian.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en In-Reply-To: <5.2.0.9.0.20030814180141.00a34430@mail.dalmatian.com> Sender: news X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Larry Young wrote on 08/15/2003 03:12 AM: > Paul, > > Yes, actually I had already gone down that road as one of my > first solutions before I posted my original message. However, when I > considered that option, I was appending the logging type, which was a > problem when trying to specify packages instead of individual classes. > But your suggestion to put it at the beginning could solve that problem. > > I'm not so worried about it being clumsy because I can always > hide it with a wrapper around the front-end if necessary (i.e. create a > static factory-like method). And I would only have to define loggers > for the logging types that my class would be using, not necessarily > every one that is defined, especially since the list needs to be > extensible. And it would also allow me to enable multiple logging types > for a single class/package. > > I'll have to give this one some more thought! It's not the > cleanest of solutions, but if no one else on the list thinks this would > be a good feature to have, then perhaps this would be the quickest > solution for my situation. Thanks again for your ideas! > > --- regards --- > Larry > > > > At 10:51 AM 8/15/03 +1000, you wrote: > >> On Fri, 2003-08-15 at 10:52, Larry Young wrote: >> > Paul, >> > >> > Yes, I need to be able to specify which class may display >> which >> > set of discreet types. For example, I might have "com.*" allowed to >> > display ERROR, but then override that for "com.xyz.MyClass" to >> display only >> > TIMING, "com.abc.def.*" to display METHOD_TRACE & TIMING, and >> > "com.abc.dataaccess.*" to display DB_ACCESS. >> >> >> >> Yeah, the more I think about it the more I see the issue. Ouch. >> >> Ok, since in each class you like have something like this: >> >> public static final Logger LOG = Logger.getLogger(MyClass.class); >> >> Could you do something like this? (Cumbersome still, but hey, if you >> want Ultimate Configuration it comes with Ultimate complexity usually >> >> public static final DBLogger = Logger.getLogger("DB." + >> MyClass.class.getName() ); >> >> public static final TimerLogger= Logger.getLogger("Trace." + >> MyClass.class.getName()); >> >> ... >> >> That way you will have a Logger for every class and every aspect. You >> can then turn _ALL_ Trace logging by setting the "DB" Logger to whatever >> level, then all the class names inherit from it. You can then also set >> "DB" to INFO, but override with "DB.com.mycompany.MyClass=DEBUG". >> >> Would that help? >> >> cheers, >> >> Paul >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: log4j-user-help@jakarta.apache.org > > > -------------------------- > Larry Young > The Dalmatian Group > www.dalmatian.com I believe your concern will be covered in Log4j 1.3 under the topic Logging Domains. It's described in the plan as "a very powerful and innovative concept that extends the notion of hierarchical loggers. It will also allow dynamic logging with pin-point accuracy" I cannot be sure of this because there isn't much written on the subject but I remember a discussion about it somewhere (sorry, I don't remember where) that described logging domains in a way tha would cover the needs of your discreet types. Eduardo --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: log4j-user-help@jakarta.apache.org