logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject I need my web application to output to different log files
Date Thu, 20 Nov 2003 11:36:53 GMT
Hi All,

I am struggling with understanding how I may setup my webapp to output to multiple logs. At
the moment I have setup one log. My log4j.properties is in my WEB-INF/classes folder and contains;

log4j.rootLogger=debug, stdout, R

#### 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 Application)

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=appA.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern==%d [%p] %c %x %m%n

In my classes for my webapp I always use

static Logger logger = Logger.getLogger("com.mycompany.appa.AClass");

Now, for the set of classes in this package I want the logging output only to go to a new
log called appB.log.

Could anyone suggest how I do this? Do I need to add a new appender to my log4j? Do I then
override the File property of that new appender with the classes package somehow?

Thanks!


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
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