logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ravindra" <ravin...@btpsoft.com>
Subject multiple apps single log4j.xml
Date Sun, 22 Mar 2009 11:39:58 GMT
Hi Everybody,

 

I am trying to configure log4j for multiple applications using a single
log4j.xml.I placed log4j.xml in Tomcat's conf directory and placed a
log4j.jar in

Tomcat's lib directory. It is creating the log files, but it is not writing
to it.

 

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

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

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

 

  <!-- ===================================================================
-->

  <!--  Appenders
-->

  <!-- ===================================================================
--> 

  

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

    <param name="File"

           value="C:/dtu/logs/APP1.log" />

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

    <param name="MaxFileSize" value="10MB" />

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

    <param name="Threshold" value="ALL" />

 

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

            <param name="ConversionPattern" value="%d %-5p [%C{1}.%M:%L]
%m%n" />

    </layout>          

  </appender>

  

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

    <param name="File"   value="C:/dtu/logs/APP2.log" />

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

    <param name="MaxFileSize" value="10MB" />

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

    <param name="Threshold" value="ALL"/>

    

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

    <param name="ConversionPattern" value="%d %-5p [%t] [%C{1}.%M:%L] %m%n"
/>

    </layout>

 

  </appender>

  

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

    <param name="File"   value="C:/dtu/logs/APP3.log" />

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

    <param name="MaxFileSize" value="10MB" />

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

    <param name="Threshold" value="ALL"/>

    

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

    <param name="ConversionPattern" value="%d %-5p [%t] [%C{1}.%M:%L] %m%n"
/>

    </layout>

 

  </appender>

  

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

    <param name="File"   value="C:/dtu/logs/APP4.log" />

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

    <param name="MaxFileSize" value="10MB" />

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

    <param name="Threshold" value="ALL"/>

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

    <param name="ConversionPattern" value="%d %-5p [%t] [%C{1}.%M:%L] %m%n"
/>

    </layout>

 

  </appender>

  

  

  <!-- ===================================================================
-->

  <!--  Loggers
-->

  <!-- ===================================================================
-->

 

  <logger name="com.dtu">

    <level value="DEBUG"/>

             <appender-ref ref="APP1"/>

  </logger>

 

   <logger name="com.sms">

    <level value="DEBUG"/>

            <appender-ref ref="APP4"/>

  </logger>

  

  

  <logger name="com.vtu.gsm">

    <level value="DEBUG"/>

            <appender-ref ref="APP3"/>

  </logger>

 

   <logger name="com.vtu.gps">

    <level value="DEBUG"/>

            <appender-ref ref="APP4"/>

  </logger>

  

  <root>

    <level value="DEBUG"/>

    <appender-ref ref="APP1"/>

  </root>

  

  

</log4j:configuration>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message