[logback-dev] RFC: LoggingEvent redesign

Ralph Goers rgoers at apache.org
Tue Feb 24 23:49:43 CET 2009

Darn. I started to implement this and discovered that  
LocationAwareLogger doesn't have a method that accepts the object  
array so I am stuck serializing the data anyway - unless you'd care to  

public void log(Marker marker, String fqcn, int level, String message,  
Object[] argArray, Throwable t);

to the interface and the various implementations.


On Feb 24, 2009, at 10:25 AM, Ceki Gulcu wrote:

> Thank you for sharing this example which illustrates the point quite  
> well.
> Ralph Goers wrote:
>> Yes and no. The API would be a call like logger.logEvent(EventData  
>> data);  EventData is really just a Map with a few extra methods.  
>> Under the hood the event data gets serialized to XML as the  
>> "message" but the EventData map is still passed as a parameter.  
>> Then when the Appender gets the LoggingEvent it can first check for  
>> the map being present. If it is it can just use it and the  
>> serialized XML just gets ignored. Otherwise we have to go through  
>> the expense of reconstructing the map from the message. If one of  
>> the out-of-the box Appenders is used then the map will be ignored  
>> and only the serialized map is recorded, but if someone wants to  
>> write a custom appender it will save quite a bit of overhead in not  
>> having to reconstruct the EventData map on every audit event.
>> Ralph
> -- 
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework  
> for Java.
> http://logback.qos.ch
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://qos.ch/mailman/listinfo/logback-dev

More information about the logback-dev mailing list