[logback-user] Split long data on multiple rows

Anders Hammar anders at hammar.net
Tue Sep 22 08:08:48 CEST 2009


I have a framework that utilizes logback-core for logging. Due to
limitations in the software reading the log files, a new requirement is that
long data should be split on multiple rows. I'm trying to figure out if
there a simple way of doing this?

More info: What I have is an extension of the PatternLayoutBase which adds
the converters for my event class. I'm using the standard
RollingFileAppender. So, let's say I have a FooConverter, which gets the foo
info from the event. But, when logging to the file, the foo info part must
never be longer than x chars. If it is, it should be split on multiple rows.
Other data (generated by other converters) should then be repeated.

Any suggestions on how to do this in a clean logback way is appreciated!
What I'm currently thinking is to loop on the converters (calling
multiple times), but I need to know when that's required... Anyone done
something similar?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20090922/6a5360fe/attachment.htm>

More information about the Logback-user mailing list