[logback-dev] [Bug 137] add option to FileAppender to auto-create parent directories

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Thu Mar 20 16:44:07 CET 2008


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





------- Comment #1 from bruno.navert at morganstanley.com  2008-03-20 16:44 -------
This subclass does the trick, but an option in FileAppender would be much
better (I used RollingFileAppender because this is what I needed in my
project):

public class DirectoryCreateRollingFileAppender<E> extends
RollingFileAppender<E>
{
    @Override
    public synchronized void setFile() throws IOException
    {
        // create parent directories as needed
        new File( fileName ).getParentFile().mkdirs();

        // then proceed as usual
        super.setFile();
    }
}


-- 
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