logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi Vemuri <Ravi.Vem...@three.co.uk>
Subject JDBC Async Appender
Date Mon, 02 Aug 2004 14:46:21 GMT
Hi All,

 

I am using JDBCAppender to log to the database and want this to be
asynchronous. I am using the XML configuration given below but the logging
is taking much longer than can be expected and the performance is much
better with logging switched off. Can someone please take a look at the
log4j.xml and let me know if there is something wrong or something I need to
do to make it asynchronous. 

 

Thanks,

 

- Ravi Vemuri

 <!--
############################################################################
# -->

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

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

 

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

 

            <appender name="A1" class="org.apache.log4j.ConsoleAppender">

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

                             <param name="ConversionPattern" 

                            value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %-20c{3}
[%x] %m%n"/>

                        </layout>

            </appender>

 

            <appender name="StatsLogger"
class="org.apache.log4j.DailyRollingFileAppender">

                             <param name="DatePattern" 

                            value="yyyy-MM-dd"/>

                             <param name="File"
value="c:\\PGA\\logs\\pgastats.log" />                            

 

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

                             <param name="ConversionPattern" 

                            value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %-20c{3}
[%x] %m%n"/>

                        </layout>

            </appender>

 

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

                             <param name="DatePattern" 

                            value="yyyy-MM-dd"/>

                             <param name="File"
value="c:\\PGA\\logs\\pgacoreapp.log" />                            

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

                             <param name="ConversionPattern" 

                            value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %-20c{3}
[%x] %m%n"/>

                        </layout>

            </appender>

 

            <appender name="DBLogger"
class="adaptor.common.dblogging.DBLogger">

                             <param name="DatePattern" 

                            value="yyyy-MM-dd"/>

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

                             <param name="ConversionPattern" 

                            value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %-20c{3}
[%x] %m%n"/>

                        </layout>

            </appender>

 

            <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">

            <appender-ref ref="DBLogger"/>

            </appender>

            

              <category name="a.b">    

                        <priority value="debug" />    

                        <appender-ref ref="ConsoleLogger" />    

              </category>

 

              <category
name="adaptor.cardtransaction.common.PGAServiceStatistics">    

                        <priority value="info" />    

                        <appender-ref ref="StatsLogger" />    

              </category>

  

            <logger name="adaptor.common.dblogging.DBLogger"
additivity="false">

                  <level value="DEBUG"/>

                  <appender-ref ref="DBLogger"/>

            </logger>

            

            <root>

               <priority value ="fatal" />

               <appender-ref ref="A1" />

            </root>

            

</log4j:configuration>

 <!--
############################################################################
# -->

 



________________________________________________________________________

This e-mail message (including any attachment) is intended only for the personal 
use of the recipient(s) named above. This message is confidential and may be 
legally privileged.  If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, please notify 
us immediately by e-mail and delete the original message.

Any views or opinions expressed in this message are those of the author only. 
Furthermore, this message (including any attachment) does not create any legally 
binding rights or obligations whatsoever, which may only be created by the exchange 
of hard copy documents signed by a duly authorised representative of Hutchison 
3G UK Limited.
________________________________________________________________________


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