1 Reply Latest reply on Mar 15, 2004 8:34 AM by morenito9000

    Configure differnet appenders in log4j.xml

    cluck Newbie


      I know I can get log4j to use a different appended for a particular package of classes - but I've no idea how to configure this in log4j.xml. Anyone got any examples where the bulk of logging messages go to server.log and logging messages from a particular package go to another log file?


        • 1. Re: Configure differnet appenders in log4j.xml
          morenito9000 Newbie

          I don't know if this could answer to your question.

          I added an appender to a category that I refer to
          in my code.

          log4j.xml (lines added):

          < appender name="XMALFAPPENDER" class="org.apache.log4j.RollingFileAppender" >
          < param name="File" value="/tmp/XMALF-JBOSS.log"/ >
          < param name="Append" value="false"/>

          < layout class="org.apache.log4j.PatternLayout" >
          < param name="ConversionPattern" value="%d %-5p [%c] %m%n"/ >
          < /layout >
          < /appender >

          < category name="XMALF" >
          < priority value="INFO" / >
          < appender-ref ref="XMALFAPPENDER"/ >
          < /category >

          (ignore blanks after < and before > ;-)).