[logback-user] Appender with a triggering level

Bee-lindgren, Bert A bert.bee-lindgren at oit.gatech.edu
Fri Dec 17 22:44:55 CET 2010

This email is about a method to save detailed log output from failed operations but not from successful operations.

Our programs try to put all pertinent information in MDC properties or in an error message itself, but sometimes we have found it helpful to have the debug/info message to show what led up to an error. Therefore, we keep debug/info logs when we don't need 99.99% of it; we only need it in the rare occurrence of an error.

We already have the concept of a thread-specific appender that processes Events for a single thread (fwiw, we use this to capture server-side messages for client requests and then send them back to the client).

What do people think about this idea:
1. An appender with two levels: BaseLevel and TriggerLevel
   (this would probably be a subclass of AppenderBase and call super(layout, BaseLevel)

2. Appender's append() method stores (List, CircularBuffer, etc) ILoggingEvents >= BaseLevel

3. If an event happens >=TriggerLevel, Appender prints all stored events as well as all future events

Thanks for your feedback,
  Bert Bee-Lindgren

More information about the Logback-user mailing list