@ Override protected final void subAppend ( final LoggingEvent event ) { if ( event instanceof ScheduledFileRollEvent ) { // the scheduled append() call has been made by a different thread synchronized ( this ) { if ( this . closed ) { // just consume the event return ; } this . rollFile ( event ) ; } } else if ( event instanceof FileRollEvent ) { // definitely want to avoid rolling here whilst a file roll event is still being handled super . subAppend ( event ) ; } else { if ( event instanceof FoundationLof4jLoggingEvent ) { FoundationLof4jLoggingEvent foundationLof4jLoggingEvent = ( FoundationLof4jLoggingEvent ) event ; foundationLof4jLoggingEvent . setAppenderName ( this . getName ( ) ) ; } this . rollFile ( event ) ; super . subAppend ( event ) ; } }
Responsible for executing file rolls as and when required in addition to delegating to the super class to perform the actual append operation . Synchronized for safety during enforced file roll .