[logback-user] Conditional RollingFileAppender or Sifter?

Sean Crotty scrotty at gmail.com
Sat May 22 00:26:18 CEST 2010


Can I configure a RollingAppender/Sifter to NOT keep a file if a certain
condition is not met? For example, I don't want to save rolled files that
don't have at least one logged statement of WARN level or higher.

 

Here is my use case: have a sifter that creates multiple files - one per
transaction. There are thousands of transactions in my system. I only want a
transaction log file saved if there is something interesting about that
particular transaction. For me, "interesting" is a WARN or ERROR statement
in the log file.

 

I don't know if this would be part of the RollingFileAppender or maybe
something done when the sifter times out.

 

Any advice?

 

Thanks!

Sean

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


More information about the Logback-user mailing list