Hi Otis,

Re your comment
>Reading about AsyncAppender made me want to switch to it from FileAppender.

AsyncAppender isn't a complete appender;
it is a "wrapper" that can be placed around
another appender. The AsyncAppender is
configured with an appender instance (eg
an instance of JMSAppender). The 
AsyncAppender queues logged messages,
and in a separate thread passes off the 
messages to whatever "real" appender
it is configured with.

This is similar to the way the java stream 
libraries work; for example, the 
java.io.BufferedReader class is just a
wrapper on a java.io.Reader class.

The AsyncAppender therefore allows any
appender to be run in Async mode without
having to build async features into every
appender.

I'm not sure if using an AsyncAppender as
a wrapper around FileAppender is going to
be very useful, as the overhead of all the
message buffering may be more than the
gains - you'll have to make some measurements
to figure out if it's worth it.

Regards,

Simon
> -----Original Message-----
> From: Otis Gospodnetic [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, February 13, 2001 5:28 PM
> To:   [EMAIL PROTECTED]
> Subject:      Multiple AsyncAppenders -> multiple threads?
> 
> Hello,
> 
> Reading about AsyncAppender made me want to switch to it from
> FileAppender.
> However, before I do that I'm wondering about the following:
> 
> Is the number of threads created by Log4J, when AsyncAppenders are being
> used, proportional to the number of AsyncAppenders that one is using/has
> defined?
> In other words, if I create 20 different AsyncAppenders will that create
> 20
> separate threads, one for each of them?
> 
> Thank you,
> 
> Otis
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to