Hi,
I need some help with Log4J configuration (I am using log4j.properties file + Tomcat 5.X).
I have configured logging like this.
log4j.rootCategory=info, BX, AX, AXMAIL
log4j.category.com.mycompany.myproject.usermodule=info, BX
log4j.category.com.mycompany.myproject.adminmodule=info, AX
## File appender 1
log4j.appender.BX=org.apache.log4j.DailyRollingFileAppender
log4j.appender.BX.File=${catalina.home}\\logs
bxlog.log
.....
## File appender 2
log4j.appender.AX=org.apache.log4j.DailyRollingFileAppender
log4j.appender.AX.File=${catalina.home}\\logs
axlog.log
## EMAIL appender
log4j.appender.AXMAIL=org.apache.log4j.net.SMTPAppender
.... with smtp configuration..
Everything works fine..
Now, I want to configure All FATAL messages to be emailed using the AXMAIL, but let the AX appender log the messages in the axlog.log file (including info and fatal).
Basically I want 2 levels for the same category, like this:
log4j.category.com.mycompany.myproject.adminmodule=info, AX
log4j.category.com.mycompany.myproject.adminmodule=fatal, AXMAIL
Is this possible ?
Tech. Gurus.. plz help me..
- Hari
Discussions
Web tier: servlets, JSP, Web frameworks: Log4j Help (multiple levels with in same category)
-
Log4j Help (multiple levels with in same category) (1 messages)
- Posted by: Hari Krishna
- Posted on: January 23 2009 10:48 EST
Threaded Messages (1)
- Re: Log4j Help (multiple levels with in same category) by Hari Krishna on January 23 2009 11:26 EST
-
Re: Log4j Help (multiple levels with in same category)[ Go to top ]
- Posted by: Hari Krishna
- Posted on: January 23 2009 11:26 EST
- in response to Hari Krishna
I have set the additivity as: log4j.additivity.com.mycompany.myproject.usermodule=false log4j.additivity.com.mycompany.myproject.adminmodule=false