Hi Ceki,<br>It is (kind of) clear. The only part I have problems with is: &quot;...Place logging events in a queue, and if the queue becomes full, drop new events...&quot;<br>How exactly I&#39;d do this? Do I have to implement some method that &quot;drops new events if the queue becomes full&quot; or there&#39;s already<br>
something built-in.<br>I know that (From the Log4j Manual: &quot;...If however the queue is full, then AsyncAppender.append() will not return until free space becomes available.&quot; ) So if the queue becomes full the dispatcher thread will try to free the space by removing the oldest events from the queue and dispatch them to each attached appender but if the only appender is the SocketAppender that can&#39;t process anything at the moment, since<br>
there&#39;s no comunication to the server, what&#39;s going to happend? <br> Some additional explanation and maybe a few lines of code would help.<br>Thanks a lot.<br>Greg.<br><br><br><br><br><div class="gmail_quote">On Wed, May 13, 2009 at 4:52 AM, Ceki Gulcu <span dir="ltr">&lt;ceki@qos.ch&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
If reactivity is what you are looking for, I would suggest that you wrap SocketAppender in an appender which contains a queue (see AsyncAppender in log4j). Place logging events in a queue, and if the queue becomes full, drop new events.<br>

<br>
Code for computing location information and everything else can be done by invoking methods on LoggingEvent. You don&#39;t need to store the logger.<br>
<br>
Holler if the above is not clear.<br>
<br>
Greg Flex wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
Hi Ceki,<br>
I (again) have some questions about log4j.<br>
(I guess Logback works the same way....)<br>
I was wondering if there&#39;s a way to save a &quot;logger object&quot; to a<br>
data structure like a queue or something before sending it to some appender.<br>
For example:<br>
The socket appender will cause the log4j client to lock/freeze if there&#39;s no link to the server.<br>
I verified it and it does lock the client.<br>
I need to deal with this issue so I&#39;d like to store &quot;logger objects&quot; (or something)<br>
before they go to the socket or some other appender first.<br>
At the moment I have a wrapper around the log4j that when the debug method is called<br>
I&#39;m just calling the log4j debug method passing some args etc.<br>
so I have:   logger.debug(&quot;some stuff&quot;);<br>
The configuration file does the trick and outputs to the console (at the moment) all the info:<br>
the class name, the method name, the line number etc.<br>
I&#39;d like to save this info somehow to some object that I can store in a queue or something.<br>
How do I retrieve this information programmatically? Is there a way?<br>
I know about LoggingEvent object, could I use it and pass the above stated information<br>
to its constructor then store it in a queue?<br>
Logger gets me for free (like method name etc.)<br>
Any suggestion?<br>
Thanks a lot.<br>
Greg.<br>
<br>
<br>
<br></div></div>
------------------------------------------------------------------------<div class="im"><br>
<br>
_______________________________________________<br>
Logback-user mailing list<br>
Logback-user@qos.ch<br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</div></blockquote><font color="#888888">
<br>
-- <br>
Ceki Gülcü<br>
Logback: The reliable, generic, fast and flexible logging framework for Java.<br>
<a href="http://logback.qos.ch" target="_blank">http://logback.qos.ch</a></font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Logback-user mailing list<br>
Logback-user@qos.ch<br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</div></div></blockquote></div><br>