Log4j Help (multiple levels with in same category)


Web tier: servlets, JSP, Web frameworks: Log4j Help (multiple levels with in same category)

  1. 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
  2. I have set the additivity as: log4j.additivity.com.mycompany.myproject.usermodule=false log4j.additivity.com.mycompany.myproject.adminmodule=false