You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ho...@i2.com on 2001/04/12 15:17:26 UTC

SocketAppender Format and Flushing


1) The SocketAppender API explains "SocketAppenders do not use a layout.
They ship a serialized
LoggingEvent object to the server side." Does this mean I cannot configure
the output format on the client side but I can on the server side.

2) Also I wonder if the logging request gets flushed out  immediately? If
not, then how soon the logging request got sent and should I use
SocketAppender.close to help flush it, like:

     Category  cat = Category.getInstance("com.xyz.FirstTry");

     SocketAppender sa = new SocketAppender(host, port);
     cat.addAppender(sa);

     cat.setPriority(Priority.INFO);
     cat.warn("You should see this WARN message.");
     sa.close();

Thank you!


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


Re: SocketAppender Format and Flushing

Posted by Ceki Gülcü <cg...@qos.ch>.
At 08:17 12.04.2001 -0500, Hoa_Hong@i2.com wrote:


>1) The SocketAppender API explains "SocketAppenders do not use a layout.
>They ship a serialized
>LoggingEvent object to the server side." Does this mean I cannot configure
>the output format on the client side but I can on the server side.

Yes. 

>2) Also I wonder if the logging request gets flushed out  immediately? If
>not, then how soon the logging request got sent and should I use
>SocketAppender.close to help flush it, like:
>
>     Category  cat = Category.getInstance("com.xyz.FirstTry");
>
>     SocketAppender sa = new SocketAppender(host, port);
>     cat.addAppender(sa);
>
>     cat.setPriority(Priority.INFO);
>     cat.warn("You should see this WARN message.");
>     sa.close();

If you close "sa" then you will not be able to write to it again. Closing is important when leaving the application. Regards, Ceki


--
Ceki Gülcü     Web: http://qos.ch 
email: cgu@qos.ch or ceki_gulcu@yahoo.com


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