[logback-dev] RFC 5424 and Structured Data support.

Ralph Goers rgoers at apache.org
Sun Dec 13 22:36:24 CET 2009


On Dec 3, 2009, at 6:33 AM, Ralph Goers wrote:

> 
> On Dec 3, 2009, at 3:26 AM, Joern Huxhorn wrote:
> 
>> 
>> All work concerning the wrapping is already done in my branch.
>> See http://github.com/huxi/slf4j/tree/slf4j-redesign/slf4j-n-api-new-integration-test/ and http://github.com/huxi/slf4j/tree/slf4j-redesign/slf4j-n-api-old-integration-test/ for examples.
>> 
>> Another nice thing is the simplicity of new Logger implementations. This is quite obvious if you compare the TestLogger implementations of the two integration-tests.
> 
> I'll try to put this stuff in my branch and see what happens.
> 

I've modified my fork to support Messages rather than just StructuredData. The SLF4J api is backward compatible. Logback isn't completely. Calling getMessage on a LoggingEvent now returns the Message object, not the message format string. To get that you call getMessage().getMessageFormat(). I actually like this quite a bit more than trying to add the StructuredData as a parameter.  I would have liked to do more but it would have meant breaking the TurboFilter interface and I didn't want to do that.

The only issue I found was with LoggingEventSerializationPerfTest. It failed because averageSize exceeds averageSizeLimit. I've looked at that code but for the life of me I can't understand what it is attempting to validate. The size seems to be calculated by incrementing a counter everyting NoopOutputStream's write method is called. My guess is that this is an attempt to determine the length of the serialized data. The trouble is, when I changed the output stream to a FileOutputStream and serialized the object to it then size of the file was not even close to the value returned by NoopOutputStream's size method.  Is that what is being attempted here? What is the real value in limiting the size? When I looked at the test the limit on the first test is 60 while the actual is 58. With the Message object replacing the message string and parameters the value is now 68.

Ralph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-dev/attachments/20091213/d0b0aff2/attachment.html>


More information about the logback-dev mailing list