DebugAppender ImmediateFlush Property | Apache log4net™ SDK Documentation

Gets or sets a value that indicates whether the appender will flush at the end of each write.

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

C#
VB
C++
F#
Copy

    public bool ImmediateFlush { get; set; }

    Public Property ImmediateFlush As Boolean
    	Get
    	Set

    public:
    property bool ImmediateFlush {
    	bool get ();
    	void set (bool value);
    }

    member ImmediateFlush : bool with get, set

#### Property Value

Type: Boolean
Remarks

The default behavior is to flush at the end of each write. If the option is set tofalse, then the underlying stream can defer writing to physical medium to a later time.

Avoiding the flush operation at the end of each append results in a performance gain of 10 to 20 percent. However, there is safety trade-off involved in skipping flushing. Indeed, when flushing is skipped, then it is likely that the last few log events will not be recorded on disk when the application exits. This is a high price to pay even for a 20% performance gain.

See Also

#### Reference

DebugAppender Class
log4net.Appender Namespace