
What about intrducing the Encoder interface I proposed some weeks ago ? http://code.google.com/p/firewood/source/browse/trunk/compare-formats/src/ma... ============================== import java.io.OutputStream; import java.io.IOException; import ch.qos.logback.classic.spi.ILoggingEvent; public interface Encoder <T extends OutputStream>{ void encode(ILoggingEvent event, T output) throws IOException; T decorate(OutputStream os) throws IOException; } ============================== import ch.qos.logback.classic.spi.ILoggingEvent; import java.io.OutputStream; import java.io.IOException; import java.io.ObjectOutputStream; /** * Encoder that uses plain Java Serialization */ public class ObjectEncoder implements Encoder<ObjectOutputStream> { public void encode(ILoggingEvent event, ObjectOutputStream output) throws IOException { output.writeObject(event); } public ObjectOutputStream decorate(OutputStream os) throws IOException { return new ObjectOutputStream(os); } } ===================================== By the way, Joern, trying out a recent version of Lilith is still on my todo list. regards, Maarten On Thu, Apr 23, 2009 at 6:38 PM, Joern Huxhorn <jhuxhorn@googlemail.com> wrote:
Hi Ceki.
I'd like to implement a file appender that writes the binary Lilith format, i.e. gzipped protobuf-serialized events, instead of Strings. I'd also like to have the same functionality that's supported by RollingFileAppender right now.
Unfortunately, there seems to be no way to simply write bytes instead of a String. How would you go from here? Reimplementing everything from the start seems to be a pretty bad idea.
What do you think about enhancing the RFA so it's using byte[] instead of Strings? The current behavior could be implemented using those methods + string.getBytes("UTF-8") or CharsetEncoder...
Any idea, suggestions?
Regards, Joern.
_______________________________________________ logback-dev mailing list logback-dev@qos.ch http://qos.ch/mailman/listinfo/logback-dev