I'll try to take a stab at this... Any appender that you configure behind an AsyncAppender will operate asynchronously. This would include JDBCAppender, if you have log4j configured properly.
While different appenders behind AsyncAppender will have different performance (different number of messages logged per second, different total CPU usage, etc), this shouldn't matter to the main application itself because all of this activity takes place on a different thread. If JDBCAppender takes X milliseconds to produce a log entry, the main thread(s) of execution will already be working on something else. Essentially, logging is mroe or less 'free' when you use AsyncAppender. Note that AsyncAppender can't be configured with a properties file, but must use an XML configuration file. I have attached a sample xml configuration file that uses AsyncAppender. -----Original Message----- From: Mittal, Manisha [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:44 AM To: Log4J Developers List Subject: Asynchronus Database calls Hi All, I just started working with Log4J. I have been spending time with log4J figuring out the options for Asynchronus logging. I found AsyncAppender as one of the options. I have a question here, which Appender used with AsyncAppender provides best performance. Can I use JDBCAppender with AsyncAppender, will my log calls still remain Asynchronus? Any help will be appreciated, Manisha- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="ASYNC-APPENDER" class="org.apache.log4j.AsyncAppender"> <appender-ref ref="CONSOLE"/> </appender> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.err"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601}: %-5p (%c{3}) - %m%n"/> </layout> </appender> <root> <priority value="DEBUG"/> <appender-ref ref="ASYNC-APPENDER"/> </root> </log4j:configuration>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
