3 Replies Latest reply on Aug 7, 2012 3:59 PM by JBoss Developer

    Separating App level logs from Server logs

    Kishor Pawar Newbie

      Hi,

       

      I have few applications running on my JBOSS. I wanted to separate out the log statements from the various applications in separate log files.

      I have achieved this by creating a file LoggerConfig file as below.

      But How can i avoid the this log statements from entering into server.log??

       

      <?xml version="1.0" encoding= "UTF-8" ?>

      <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

       

      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

       

          <appender name="ABC_ERROR" class="org.apache.log4j.RollingFileAppender">

              <param name="Append" value="true" />

              <param name="File" value="${jboss.server.log.dir}/abc_error.log" />

              <param name="MaxFileSize" value="500KB" />

              <param name="MaxBackupIndex" value="10" />

       

              <layout class="org.apache.log4j.PatternLayout">

                  <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />

              </layout>

              <filter class="org.apache.log4j.varia.LevelRangeFilter">

                  <param name="levelMin" value="WARN" />

                  <param name="levelMax" value="FATAL" />

              </filter>

          </appender>

       

          <appender name="ABC_LOG" class="org.apache.log4j.RollingFileAppender">

              <param name="Append" value="true" />

              <param name="File" value="${jboss.server.log.dir}/abc_log.log" />

              <param name="MaxFileSize" value="500KB" />

              <param name="MaxBackupIndex" value="10" />

       

              <layout class="org.apache.log4j.PatternLayout">

                  <param name="ConversionPattern" value="%d %-5p [%c] %m%n" />

              </layout>

              <filter class="org.apache.log4j.varia.LevelRangeFilter">

                  <param name="levelMin" value="DEBUG" />

                  <param name="levelMax" value="INFO" />

              </filter>

          </appender>

       

       

          <logger name="ABCLog">

              <appender-ref ref="ABC_LOG" />

          </logger>

         

          <logger name="ABCErrorLog">

              <appender-ref ref="ABC_ERROR" />

          </logger>

       

      </log4j:configuration>