Correct me if I am wrong,
I believe all categories inherit from the root category. The output of a log
statement of category C will go to all the appenders in C and its parents.
So, in your case since your maillog inherits from root category which routes
to weblogic log, they go to both the outputs.
Your problem could be solved if you add another property
log4j.additivity.mailLog=false.
This line says just route to my appender and not to any of my parent's
appenders.
Hope this helps.
Van
-----Original Message-----
From: Reddy Duggempudi [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 20, 2001 8:44 AM
To: [EMAIL PROTECTED]
Subject: Logging to multiple files from application server
Hi,
We are running Weblogic server 5.1. We have an application log file which
captures pretty much all the messages. I would like to have a separate log
file for our MailAgent. I added a fileAppender just for that class. For some
reason LOG4J is logging all the mail messages both into our application log
and mail.log. How do I supress mail messages going into app.log?
We initialize the PropertyConfigurator.configure("props.lcf");
once when the server comes up. If I have 2 lcf files, would I get conflicts
when I load both of them?
----------------------------------------------------------
log4j.rootCategory=debug, R
# R is set to be a RollingFileAppender sending its output to cap.log
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/opt/weblogic/myserver/app.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Appender stdout writes stdout
log4j.appender.stdout=org.apache.log4j.FileAppender
log4j.appender.stdout.File=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# maillog is set to be a RollingFileAppender sending its output to mail.log
log4j.category.com.foo.mailagent.MailAgent=debug, maillog
log4j.appender.maillog=org.apache.log4j.RollingFileAppender
log4j.appender.maillog.File=/opt/weblogic/myserver/mail.log
log4j.appender.maillog.MaxFileSize=10MB
log4j.appender.maillog.MaxBackupIndex=10
log4j.appender.maillog.layout=org.apache.log4j.PatternLayout
log4j.appender.maillog.layout.ConversionPattern=%d%n%m%n
----------------------------------------------------------
thanks in advance,
- Reddy
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]