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 Fri, 08 Nov 2002 17:09:39 GMT
should we open a bug report to change that?

-----Original Message-----
From: Ricardo Moral [mailto:ricardo_moral@yahoo.com]
Sent: Friday, November 08, 2002 9:32 AM
To: Log4J Users List
Subject: RE: log4j SocketAppender questions


Yes... You r right. It should be protected. You
shouldnt call this method directly this method should
by called only by the Log4j classes.

--- Samuel Cheung <SCheung@Novarra.com> wrote:
> Ricardo,
> 
> Yes, the append() method of AppenderEskeleton is
> protected but the append()
> method of SocketAppender() is public. The append()
> method of
> SocketAppender() should be protected as well. Is
> that correct?
> 
> -----Original Message-----
> From: Ricardo Moral [mailto:ricardo_moral@yahoo.com]
> Sent: Friday, November 08, 2002 7:05 AM
> To: Log4J Users List
> Subject: RE: log4j SocketAppender questions
> 
> 
> --- Samuel Cheung <SCheung@Novarra.com> wrote:
> > Thanks. Then shouldn't append() be protected
> instead
> > of public? So that
> > application can not call append() and call
> > doAppend() instead?
> 
> In the version I have 1.2.7 the append() method of
> AppenderEskeleton is protected. So this is OK.
> 
> > 
> > And do you know the answer of my Network
> > transmittion question? Does every
> > append result in transmitting a packet?
> > 
> 
> No there is no buffer in SocketAppender. The
> LoggingEvent to be logged will be written directly
> to
> a ObjectOutputStream that wrapps the OutputStream of
> the socket. So if you need buffering you can wrapp
> the
> SocketAppender in a Appender that implements
> buffering
> and wrapps this appender. For this you might use
> AsyncAppender.
> 
> > 
> > -----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
> > http://launch.yahoo.com/u2
> > 
> > --
> > 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>
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
> 
> --
> 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>
> 


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

--
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>


Mime
View raw message