Comments below.

At 18:05 04.09.2002 -0700, sk k wrote:

>Hi,
>
>I did the test with AsyncAppender using an xml config
>file(set the buff size to 1000 even though default
>size of 128 should be sufficient. My logger uses a
>size of like 60 ) and it seems the performance isn't
>any better. Infact the performance dropped a little
>and it seems to vaildate the AsyncAppender performance
>numbers shown in the javadocs.
>
>Pls let me know if anything is wrong or needs to be
>tuned.
>
>config file:
>=============
>
><log4j:configuration
>xmlns:log4j="http://jakarta.apache.org/log4j/";
>debug="true" >
>
>    <appender name="dest1"
>class="org.apache.log4j.RollingFileAppender">
>       <param name="File"
>value="c:/skk/cps/logger/test/test1.log"/>
>       <param name="MaxFileSize" value="4MB"/>
>       <param name="MaxBackupIndex" value="2"/>
>                 <layout class="org.apache.log4j.TTCCLayout"/>
>    </appender>
>
>   <appender name="dest2"
>class="org.apache.log4j.RollingFileAppender">
>      <param name="File"
>value="c:/skk/cps/logger/test/test2.log"/>
>      <param name="MaxFileSize" value="4MB"/>
>      <param name="MaxBackupIndex" value="2"/>
>      <param name="BufferSize"  value="1000"/>
>      <layout class="org.apache.log4j.TTCCLayout"/>
>   </appender>
>
>    <category name="ut.log.Log4jPerfTest"
>additivity="false">
>       <priority value="debug"/>
>       <appender-ref ref="dest2"/>
>    </category>
>
>         <root>
>                 <priority value="DEBUG"/>
>                 <appender-ref ref="dest1"/>
>         </root>
></log4j:configuration>
>
>I am measuring the time when the method starts and
>    and when it returns and it seems that
>    the background task time is not accounted for using
>my logger and it is accounted for while using log4j.
>
>It seems that application shouldn't wait till the log
>message has been written as it would degrade
>peformance  .


The above configuration XML script does not use nor mention
AsyncAppender. Try the following

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

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

   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
     <param name="BufferSize" value="20000"/>
     <appender-ref ref="dest1" />
   </appender>

   <appender name="dest1"
     class="org.apache.log4j.FileAppender">
     <param name="File"
       value="c:/skk/cps/logger/test/test1.log"/>
     <layout class="org.apache.log4j.TTCCLayout"/>
   </appender>

   <root>
     <priority value="DEBUG"/>
     <appender-ref ref="ASYNC"/>
   </root>
</log4j:configuration>

You may want to post the Java code that takes the measurements.


--
Ceki

TCP implementations will follow a general principle of robustness: be
conservative in what you do, be liberal in what you accept from
others. -- Jon Postel, RFC 793



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to