logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samuel Cheung <SChe...@Novarra.com>
Subject RE: log4j SocketAppender questions
Date Thu, 07 Nov 2002 21:25:41 GMT
Thanks. Then shouldn't append() be protected instead of public? So that
application can not call append() and call doAppend() instead?

And do you know the answer of my Network transmittion question? Does every
append result in transmitting a packet?

-----Original Message-----
From: Ricardo Moral [mailto:ricardo_moral@yahoo.com]
Sent: Thursday, November 07, 2002 3:04 PM
To: Log4J Users List
Subject: Re: log4j SocketAppender questions

No, there is no need to synchronize the log method
before calling any logger that uses this appender.

This is because this appender extends the
AppenderSkeleton class. The AppenderSkeleton class is
the base class for many of the Appenders (Console,
JDBC, etc) and implements the
<code>doAppend(LoggingEvent)</code> method wich is the
method called by the Logger to report LoggingEvents.
This method is synchronized and calls the
<code>append(LoggingEvent)</code> that is an abstract
method that must be implemented in subclases... 

--- Samuel Cheung <SCheung@Novarra.com> wrote:
> Hi,
> Is SocketAppender in log4j thread safe? If I have
> multiple threads log to
> the same SocketAppender, do I need to synchronize
> that the log method? 
> And does SocketAppender have any internal buffer?
> Will every log() call
> result in a network transmission? Or SocketAppender
> will buffer all the logs
> until it reaches certain limit before it sends out
> the log thru the network
> transmission.
> Thank you for any information.
> Sam
> --
> To unsubscribe, e-mail:  
> <mailto:log4j-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:log4j-user-help@jakarta.apache.org>

Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

View raw message