Appender with a triggering level

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

On Dec 17, 2010, at 1:44 PM, Bee-lindgren, Bert A wrote:
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
Using log levels for what you are proposing will lead to problems. Instead, I'd suggest just generating an event that contains a Trigger Marker. Then when the trigger occurs you can publish the previous events. Ralph

On 19.12.2010 19:03, Ralph Goers wrote:
On Dec 17, 2010, at 1:44 PM, Bee-lindgren, Bert A wrote:
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
Using log levels for what you are proposing will lead to problems. Instead, I'd suggest just generating an event that contains a Trigger Marker. Then when the trigger occurs you can publish the previous events.
Yep, using a marker to trigger a particulat action, printing in your case, is the recommended approach.
Ralph
-- Ceki
participants (3)
-
Bee-lindgren, Bert A
-
Ceki Gulcu
-
Ralph Goers