[logback-dev] [JIRA] Commented: (LBCORE-128) Please support implementation of binary log files in RollingFileAppender/FileAppender

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Wed Feb 17 11:53:33 CET 2010


    [ http://jira.qos.ch/browse/LBCORE-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11535#action_11535 ] 

Ceki Gulcu commented on LBCORE-128:
-----------------------------------

Given that we are talking about logback extensions and not user facing code such as the SLF4J API and given the conceptual depth of this change, it's ok if compatibility with existing appenders extending FileAppender is broken. 

The generics in Maaerten's code ensures that the type of the output stream passed to a particular encoder's encode() method is verified by the compiler and avoids a cast from OutputStream to a subtype. It's just a nice touch. I think the bigger innovation comes from letting the encoder control the type of the OutputStream. The containing
appender invokes its encoder's decorate(OutputStream) method with an opened stream and then passes the decorated result to encode(ILoggingEvent, OutputStream) in the second argument. I don't see how it would be possible to achieve similar flexibility (of letting the encoder select the output stream type) more elegantly especially if you consider that the actual OutputStream might change during the lifetime of the appender (think RollingFileAppener).

The more I think of it the more I am tempted to merge the concept of a layout into an encoder. After all a Layout is an encoder which encodes events in text.

Since we talking about a very substantial change, I'll start a new branch and see how it goes.


> Please support implementation of binary log files in RollingFileAppender/FileAppender
> -------------------------------------------------------------------------------------
>
>                 Key: LBCORE-128
>                 URL: http://jira.qos.ch/browse/LBCORE-128
>             Project: logback-core
>          Issue Type: Improvement
>          Components: Appender
>    Affects Versions: 0.9.17
>            Reporter: Joern Huxhorn
>            Assignee: Ceki Gulcu
>
> This was discussed briefly at http://marc.info/?l=logback-dev&m=124905434331308&w=2 and I forgot to file a ticket about this.
> Currently, RandomFileAppender => FileAppender => WriterAppender is using the following method in WriterAppender to actually write the data:
> protected void writerWrite(String s, boolean flush) throws IOException
> Please add an additional method like
> protected void writerWrite(byte[] bytes, boolean flush) throws IOException
> to write to the underlying stream directly.
> writerWrite(String, boolean) could call that method after performing the transformation internally, making this change transparent for the rest of the implementation.
> Using a binary format for logfiles could have tremendous performance impact as can be seen here: http://sourceforge.net/apps/trac/lilith/wiki/SerializationPerformance

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list