Return-Path: Delivered-To: apmail-jakarta-log4j-user-archive@www.apache.org Received: (qmail 44698 invoked from network); 19 Sep 2003 19:39:04 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Sep 2003 19:39:04 -0000 Received: (qmail 95540 invoked by uid 500); 19 Sep 2003 19:38:46 -0000 Delivered-To: apmail-jakarta-log4j-user-archive@jakarta.apache.org Received: (qmail 95529 invoked by uid 500); 19 Sep 2003 19:38:46 -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 95516 invoked from network); 19 Sep 2003 19:38:46 -0000 Received: from unknown (HELO web40104.mail.yahoo.com) (66.218.78.38) by daedalus.apache.org with SMTP; 19 Sep 2003 19:38:46 -0000 Message-ID: <20030919193851.4166.qmail@web40104.mail.yahoo.com> Received: from [12.125.145.126] by web40104.mail.yahoo.com via HTTP; Fri, 19 Sep 2003 12:38:51 PDT Date: Fri, 19 Sep 2003 12:38:51 -0700 (PDT) From: "Dhruva B. Reddy" Subject: RE: Messages Going to Multiple Loggers To: Log4J Users List In-Reply-To: <9C5166762F311146951505C6790A9CF8A6EC3A@US-VS1.corp.mpi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Perhaps I should rephrase the question--is there any way to prevent a logger from inheriting the rootLogger's appenders? I tried adding additivity to the appender, and it didn't like it: log4j.appender.email.additivity=false resulted in: log4j:WARN No such property [additivity] in org.apache.log4j.net.SMTPAppender. I also tried adding it to the notify logger, and it ignored it: log4j.logger.notify.additivity=false Thanks, Dhruva --- "Shapira, Yoav" wrote: > > Howdy, > Try setting additivity=false for the email appender. > > Yoav Shapira > Millennium ChemInformatics > > > >-----Original Message----- > >From: Dhruva B. Reddy [mailto:sledgehammer2010@yahoo.com] > >Sent: Friday, September 19, 2003 12:57 PM > >To: log4j-user@jakarta.apache.org > >Subject: Messages Going to Multiple Loggers > > > >I am using Log4J 1.2.8 for a standalone application running on > Linux. > >I have two loggers defined--one for general use that goes to syslog > and > >another for sending e-mails when the application starts and > finishes. > > > >I use the following configuration: > > > ># General logging properties... > >log4j.rootLogger=debug,general > > > ># Log to syslog... > >log4j.appender.general=org.apache.log4j.net.SyslogAppender > >log4j.appender.general.SyslogHost=localhost > >log4j.appender.general.layout=org.apache.log4j.PatternLayout > >log4j.appender.general.layout.ConversionPattern=%p: %m > >log4j.appender.general.Facility=local7 > > > ># For sending e-mails... > >log4j.logger.notify=debug,email > > > >log4j.appender.email=org.apache.log4j.net.SMTPAppender > >log4j.appender.email.to=moi@localhost > >log4j.appender.email.from=moi@localhost > >log4j.appender.email.SMTPHost=localhost > >log4j.appender.email.subject=Something Happened > >log4j.appender.email.layout=org.apache.log4j.PatternLayout > >log4j.appender.email.layout.ConversionPattern=%m > > > >In the code in which I wish to send an e-mail, I do this: > > > > // Need this for general logging... > > Logger log = Logger.getLogger(SomeClass.class); > > > > // Need this notification of specific events... > > Logger email = Logger.getLogger("notify"); > > > >The problem is that when I use "email", the message is not only > >e-mailed, but it also goes to syslog (which I don't want). Is there > a > >way to make these log messages appear only in e-mail messages? > > > >Thanks, > >Dhruva > > > > > > > >__________________________________ > >Do you Yahoo!? > >Yahoo! SiteBuilder - Free, easy-to-use web site design software > >http://sitebuilder.yahoo.com > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org > >For additional commands, e-mail: log4j-user-help@jakarta.apache.org > > > > > This e-mail, including any attachments, is a confidential business > communication, and may contain information that is confidential, > proprietary and/or privileged. This e-mail is intended only for the > individual(s) to whom it is addressed, and may not be saved, copied, > printed, disclosed or used by anyone else. If you are not the(an) > intended recipient, please immediately delete this e-mail from your > computer system and notify the sender. Thank you. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: log4j-user-help@jakarta.apache.org > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: log4j-user-help@jakarta.apache.org