logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Dorrat <simon.dor...@gsjbw.com>
Subject RE: Help with loggers - syslogd
Date Fri, 20 Feb 2004 03:59:30 GMT
Jacob wrote:
	Set additivity to "false", although I can't give you an example of
that for 
	the property syntax.  I don't remember it because I never use it.
Should 
	be in the docs.  Anyway, if a logger inherits an appender (for
instance, 
	from one defined in the ROOT logger), but also defines its own
appender, 
	you have to set additivity to "false" in order to make the logger
use only 
	its own appender an not any inherited ones.


An example of using additivity is below:

	log4j.rootLogger.com=DEBUG, Console, ApplicationLog
	log4j.logger.com.logtest=DEBUG, Console, SpecificLog 
	log4j.additivity.com.logtest=false

In this example, all log messages will go to the Console appender and the
ApplicationLog appender, other than classes using a logger of "com.logtest",
which will go to the Console and the SpecificLog, but will not go to the
ApplicationLog.

Note that if aditivity is turned off (false, which is the default), then
messages from com.logtest will go to both the SpecificLog and the
ApplicationLog, and go to the Console twice!  So if you do want to inherit
make sure you do not specificy an appender twice.

For your case this could explain everything going to the SysLog appender, if
you have this specified higher in the hierarchy than the other application
log setting.

If this doesnt help, reply with the contents of your property file so we can
help more..

Simon Dorrat

> -----Original Message-----
> From:	Jacob Kjome [SMTP:hoju@visi.com]
> Sent:	Friday, 20 February 2004 1:58 PM
> To:	Log4J Users List
> Subject:	RE: Help with loggers - syslogd
> 
> At 02:16 PM 2/19/2004 -0500, you wrote:
> >Just tried that.  It does not really work.  I tried by having two
> instance
> >variables. One that gets the "applicationA" logger and one that gets the
> >"applicationB" logger.  "applicationA" logger is configured to use syslog
> >appender.  "applicationB" appender appends to the default appender that
> >appends to a file.  The issue is that both "applicationA" and
> "applicationB"
> >loggers logs are going to the syslogd log file.  I just want
> "applicationA"
> >logs to go to the syslogd log file.
> >
> >Any clue on how to do this?
> 
> Set additivity to "false", although I can't give you an example of that
> for 
> the property syntax.  I don't remember it because I never use it.  Should 
> be in the docs.  Anyway, if a logger inherits an appender (for instance, 
> from one defined in the ROOT logger), but also defines its own appender, 
> you have to set additivity to "false" in order to make the logger use only
> 
> its own appender an not any inherited ones.
> 
> 
> Jake
> 
> 
> 
> >Thank You
> >-----Original Message-----
> >From: lalitha.prasad_vaka.nonemployee@pfpc.com
> >[mailto:lalitha.prasad_vaka.nonemployee@pfpc.com]
> >Sent: Tuesday, February 17, 2004 5:30 PM
> >To: Log4J Users List
> >Subject: Re: Help with loggers - syslogd
> >
> >
> >
> >Hi,
> >You could use this
> >
> >log4j.rootLogger=debug, A
> >log4j.logger.applicationA=debug, applicationA
> >log4j.logger.applicationB=debug, applicationB
> >
> >#### Standard Output
> >log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> >log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> >log4j.appender.stdout.layout.ConversionPattern==%d [%p] %c %x %m%n
> >
> >#### R (Root)
> >log4j.appender.A=org.apache.log4j.RollingFileAppender
> >log4j.appender.A.File=root_Log4J.log
> >log4j.appender.A.MaxFileSize=100KB
> >log4j.appender.A.MaxBackupIndex=1
> >log4j.appender.A.layout=org.apache.log4j.PatternLayout
> >log4j.appender.A.layout.ConversionPattern=%d [%p] %c %x %m%n
> >
> >#### FundServ
> >log4j.appender.applicationA=org.apache.log4j.RollingFileAppender
> >log4j.appender.applicationA.File=FundServ_Log4J.log
> >log4j.appender.applicationA.MaxFileSize=100KB
> >log4j.appender.applicationA.MaxBackupIndex=1
> >log4j.appender.applicationA.layout=org.apache.log4j.PatternLayout
> >log4j.appender.applicationA.layout.ConversionPattern=%d %-5p %l : %m%n
> >
> >Now you can use
> >
> >Logger logger1 = Logger.getLogger("applicationA");
> >
> >
> >
> >
> >
> >
> >                       carlos1.rivera@p
> >
> >                       s.ge.com                 To:
> >log4j-user@jakarta.apache.org
> >
> >                                                cc:
> >
> >                       02/17/2004 02:08         Subject: Help with
> loggers -
> >syslogd
> >                       PM
> >
> >                       Please respond
> >
> >                       to "Log4J Users
> >
> >                       List"
> >
> >
> >
> >
> >
> >
> >
> >
> >I am trying to define a logger that I can use with the syslog appender.
> >What I want to be able to do is to have a logger that I obtain by name
> lets
> >say:
> >              Logger.getLogger("syslogdLogger");
> >How I can define this logger in the configuration file so that when
> >somebody
> >has this logger it logs to the syslogd of a machine?
> >
> >Thank you
> >
> >Carlos Javier Rivera Vazquez
> >__________________________________________________
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> >
> >
> >
> >
> >
> >-----------------------------------------
> >The contents of this email are the property of PNC. If it was not
> addressed
> >to you, you have no legal right to read it. If you think you received it
> in
> >error, please notify the sender. Do not forward or copy without
> permission
> >of the sender.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org


Goldman Sachs JBWere
Disclosure of Interest
ORG:  Goldman Sachs JBWere and/or its affiliates expect to receive or intend to seek compensation
for financial and advisory services in the next 3 months from the company or its affiliates.



GOLDMAN SACHS JBWERE PTY LTD DISCLAIMER

Goldman Sachs JBWere Pty Ltd and its related entities distributing this document and each
of their respective directors, officers and agents ("the Goldman Sachs JBWere Group") believe
that the information contained in this document is correct and that any estimates, opinions,
conclusions or recommendations contained in this document are reasonably held or made as at
the time of compilation.  However, no warranty is made as to the accuracy or reliability of
any estimates, opinions, conclusions, recommendations (which may change without notice) or
other information contained in this document and, to the maximum extent permitted by law,
the Goldman Sachs JBWere Group disclaims all liability and responsibility for any direct or
indirect loss or damage which may be suffered by any recipient through relying on anything
contained or omitted from this document.

Goldman Sachs JBWere does not represent or warrant the attached files are free from computer
viruses or other defects.  The attached files are provided, and may only be used, on the basis
that the user assumes all responsibility for any loss, damage or consequence resulting directly
or indirectly from use.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message