IFlushableFlush Method Apache log4net™ SDK Documentation
Flushes any buffered log data.

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.6.0-.NET 4.0
Syntax

bool Flush(
	int millisecondsTimeout
)

Parameters

millisecondsTimeout
Type: SystemInt32
The maximum time to wait for logging events to be flushed.

Return Value

Type: Boolean
True if all logging events were flushed successfully, else false.
Remarks

Appenders that implement the Flush(Int32) method must do so in a thread-safe manner: it can be called concurrently with the DoAppend(LoggingEvent) method.

Typically this is done by locking on the Appender instance, e.g.:

public bool Flush(int millisecondsTimeout)
{
    lock(this)
    {
        // Flush buffered logging data
        ...
    }
}

The millisecondsTimeout parameter is only relevant for appenders that process logging events asynchronously, such as RemotingAppender.

See Also

Reference