You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Swami Iyer <SI...@descartes.com> on 2002/08/13 22:55:33 UTC

RE: logging to seperate files from two different appication on same server

One way is to define different appenders and then assign to your categories.
For example the  bean MyFoo would use appender B and then I would define:

log4j.appender.B.File=/export/home/log/testdatafoo.log
..
..
..
log4j.category.MyFoo=INFO,B

Thanks,
Swami

> -----Original Message-----
> From: sunita agrawal [mailto:ag_sunita@hotmail.com]
> Sent: August 13, 2002 4:49 PM
> To: log4j-user@jakarta.apache.org
> Subject: logging to seperate files from two different 
> appication on same
> server
> 
> 
> Dear All,
> Could you please tell me what changes should I make to the 
> properties file 
> and to the Bean programs  to log messages to seperate files 
> for each of the 
> two applications.
> 
> Following is my properties file:
> 
> log4j.rootCategory=DEBUG, A
> #
> log4j.appender.A=org.apache.log4j.RollingFileAppender
> log4j.appender.A.File=/export/home/log/testdata.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 %-5p %c{1} %M - %m%n
> log4j.category.MyBean=DEBUG, A
> 
> 
> 
> This is how I am instantiating the category :
> 
> public final static Category logger = 
> Category.getInstance(MyBean.class.getName());
> 
> Thanks,
> ag
> 
> 
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>