[logback-dev] RFC: LoggingEvent redesign

Thorbjoern Ravn Andersen ravn at runjva.com
Wed Feb 25 13:03:36 CET 2009

Ceki Gulcu skrev:
> The prepareForDeferredProcessing() method in the LoggingEvent class
> addresses that problem. Whenever a logging event is about to be
> serialized or transferred to another thread, you, as an author of an
> appender, are supposed to call 
> loggingEvent.prepareForDeferredProcessing().
I think that it would be appropriate to provide a flush mechanism on an 
appender (in lack of a better word) which is accessible through the 
configuration or pattern or code.

The flush mechanism would immediately run the String-flattening of the 
arguments making them safe from all these issues.  If NOT invoked, the 
flattening would happen as lazily as possible.

I believe this behaviour should be explicitly enabled, keeping the 
default of immediately Stringifying when the event has been accepted for 

  Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"

More information about the logback-dev mailing list