[logback-dev] [Bug 151] New: FlushableAppender

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Tue May 6 14:23:08 CEST 2008


http://bugzilla.qos.ch/show_bug.cgi?id=151

           Summary: FlushableAppender
           Product: logback-core
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Appender
        AssignedTo: logback-dev at qos.ch
        ReportedBy: bruno.navert at morganstanley.com


Have appender implement the java.io.Flushable interface, or a logback-specific
interface if preferred, so that we can call Appender.flush() to manually flush
the appender's writer. Not all appenders would have this, only those  that
implement Flushable.

This would be useful in the context where buffered IO is used, but we still
want to ensure a flush is made at specific intervals. For instance, in
development I create a Spring bean that listens to application events, and
force-flushes logback after each http request has been processed by my
application, ensuring that I always see all the error logs when something
fails.

I have accomplished by subclassing RollingFileAppender to implement Flushable,
quite simply like this:
    public void flush() throws IOException
    {
        writer.flush();
    }


-- 
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the logback-dev mailing list