[logback-user] Sequence number
ceki at qos.ch
Tue Jul 2 23:50:09 CEST 2013
In your custom converter, declare a sequenceNumber as follows:
*volatile* int sequenceNumber = 0;
increment sequenceNumber for each new event:
On 02.07.2013 23:21, Felipe wrote:
> 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:
> That issue is a four years old boy now.
> I found a link on Stack Overflow
> which lead me to the following link:
> 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:
> Does anyone know of a good way to achieve sequentials?
> Best regards and thanks in advance.
65% of statistics are made up on the spot
More information about the Logback-user