logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhruva B. Reddy" <sledgehammer2...@yahoo.com>
Subject RE: Messages Going to Multiple Loggers
Date Fri, 19 Sep 2003 19:38:51 GMT
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" <Yoav.Shapira@mpi.com> 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


Mime
View raw message