Return-Path: Delivered-To: apmail-jakarta-log4j-user-archive@apache.org Received: (qmail 72952 invoked from network); 2 Apr 2002 22:53:45 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Apr 2002 22:53:45 -0000 Received: (qmail 29414 invoked by uid 97); 2 Apr 2002 22:53:48 -0000 Delivered-To: qmlist-jakarta-archive-log4j-user@jakarta.apache.org Received: (qmail 29385 invoked by uid 97); 2 Apr 2002 22:53:47 -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 29374 invoked from network); 2 Apr 2002 22:53:47 -0000 From: "Dave Bender" To: "Log4J Users List" Subject: RE: newbie: trouble making sub category log differently Date: Tue, 2 Apr 2002 16:51:22 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal In-Reply-To: <002601c1da93$4fdb3be0$d0673240@nuserve> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks Dan. It was your BTW note that set me straight. I had transposed the domain name in the configuration file. Now it's working as advertised. It seems like a great logging package, so I'm anxious to get into it. Dave -----Original Message----- From: Dan Lipofsky [mailto:danlip@nuserve.com] Sent: Tuesday, April 02, 2002 4:11 PM To: log4j-user@jakarta.apache.org Subject: Re: newbie: trouble making sub category log differently > I must be missing something obvious, but I cannot get a Category of mine to > log to a location other than that of the rootCategory. Can someone point out > what I'm missing? > > The behaviour I'd like is for all loggers to output to a file, except for > one category, which should log to the console. I've defined "A1" and "A2" as > my appenders and both are functional, in that if I assign the root category > to go there, everything goes where it's instructed to go. > > But if I assign my category, umn.edu.cidrap.admin.ContentBean, to use one or > the other or both, it doesn't. The output goes where the rootCategory is > defined to go. > > Any help would be appreciated. I think I've covered all the documentation, > but if it's there, I'm not seeing it. Everything inherits from root unless you tell it otherwise. With your setup umn.edu.cidrap.admin.ContentBean will go to both A1 and A2. To stop this turn additivity off, like log4j.additivity.umn.edu.cidrap.admin.ContentBean = false It is in the manual. Inheritance is very well documented and a key feature of log4j. Additivity flag is pretty obscure but it is in the docs. BTW, since you are in the umn.edu domain you should be naming your packages like edu.umn. - Dan > # define which appenders to use for our categories/loggers > log4j.rootCategory=DEBUG, A1 > log4j.category.umn.edu.cidrap.admin.ContentBean=, A2 > > > # A1 is set to be a ConsoleAppender which outputs to System.out. > log4j.appender.A2=org.apache.log4j.ConsoleAppender > > log4j.appender.A1=org.apache.log4j.FileAppender > log4j.appender.A1.File=log4j-test.log > > > # A1 uses PatternLayout; so does A2 > log4j.appender.A1.layout=org.apache.log4j.PatternLayout > log4j.appender.A2.layout=org.apache.log4j.PatternLayout > > # The conversion pattern uses format specifiers. Both the same. > log4j.appender.A1.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n > log4j.appender.A2.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: