[logback-user] Limiting events to one thread in email

Benoit Xhenseval bx at appendium.com
Mon Feb 28 23:35:50 CET 2011


Thanks Ceki,

I had a look at this and I'm not too sure if it is the best approach or actually feasible... Allow me to give a few more details.

1) We're using the AsyncAppender as per 
http://jira.qos.ch/browse/LBCORE-92

(by the way, it would be great to include this in an official release!)

2) The processing can happen from a JMS Message or an RMI call, or a GUI event... there is no real single entry point where I would be able to put a value in MDC...

Would a Cyclic Buffer per thread name in each event be a more appropriate approach?  What do you think?
I'm not sure we could use Thread.currentThread().getName()
to distinguish each caller as the AsyncAppender would be using their own thread and not the one that actually originated the event... In which case, the interface get() on the CyclicBuffer is not suitable since I would have no way to give it the name of the thread that called the Error...

Your opinion/suggestion/solution are appreciated,

Thanks

Benoit

-----
Have a look at
http://logback.qos.ch/recipes/emailPerTransaction.html
HTH,
--
Ceki
On 17.02.2011 15:49, Benoit Xhenseval wrote:
> Hi *,
>
> We're running an application on large multi-threaded servers.  When an
> exception/error occurs, we send an email with the last 50 DEBUG entries
> or so.
>
> How could we ensure that these 50 entries are limited to the Thread that
> is actually sending the error email?
>
> If there is no such implementation, what would be the recommended way?
>
> We can probably contribute it back to the community
>
> Many thanks
>
> Benoit
>


-- 
IMPORTANT NOTICE This communication contains information that is considered confidential and may also be privileged . It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender and delete the original.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110228/080a6409/attachment.html>


More information about the Logback-user mailing list