[logback-user] Sequence number

Felipe felipenaranja at gmail.com
Tue Jul 2 23:21:56 CEST 2013


Hi everyone:

I'm writing to all of you because I want to display a sequence number for
each event. I've done some research regarding this and I know for sure that
LogBack is not able to natively handle this as Log4j2 does with %sn, or as
JUL partially does with getSequenceNumber() (I won't be changing LogBack
because of this, anyway).

I know for sure LogBack is lacking this functionality because of this issue
on JIRA:

http://jira.qos.ch/browse/LOGBACK-546

That issue is a four years old boy now.

I found a link on Stack Overflow (
http://stackoverflow.com/questions/11162951/line-numbers-with-logback)
which lead me to the following link:

http://logback.qos.ch/manual/layouts.html#customConversionSpecifier

I tried a static number but it was shared across threads so it didn't work
that well. I also thought of ThreadLocal but I read a story which freaked
me out:

http://niklasschlimm.blogspot.com/2012/04/threading-stories-threadlocal-in-web.html

Does anyone know of a good way to achieve sequentials?

Best regards and thanks in advance.

-- 
Felipe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130702/fe2cea7e/attachment.html>


More information about the Logback-user mailing list