[logback-user] log a whole transaction if a condition is satisfied

Borja Ruiz bortx10 at gmail.com
Tue Nov 20 12:24:56 CET 2007


Hello,

I'm writing an application and I would like to use logback features to model
this scenario:

My application processes client requests. Each request is identified by a
transaction id, that appears on each log message. What I want to do is log
all transaction messages if a condition in one transaction message is
satisfied.

For example, if my application generates those messages:

[INFO] [transactionId=10] Searching...
[INFO] [transactionId=11] Searching...
[INFO] [transactionId=10] response=false
[INFO] [transactionId=11] response=true
[INFO] [transactionId=10] Finished
[INFO] [transactionId=11] Finished

And my condition is that variable "response" is set to true, my application
output should be:

[INFO] [transactionId=11] Searching...
[INFO] [transactionId=11] response=true
[INFO] [transactionId=11] Finished

I've tried to figure out using buffered appenders to maintain log messages,
filters to check conditions and triggers to decide when to log messages, but
couldn't find a suitable solution. I would like to know if there is a way of
solving this problem using logback provided features, or ideas to develop my
own logback components.

Thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-user/attachments/20071120/498ad332/attachment.htm 


More information about the Logback-user mailing list