ImmediateFlush Property

log4net SDK Reference |

# TextWriterAppender.ImmediateFlush Property

Gets or set whether the appender will flush at the end of each append operation.

[Visual Basic]
Public Property ImmediateFlush As Boolean
[C#]
public bool ImmediateFlush {get; set;}

#### Property Value

The default behavior is to flush at the end of each append operation.

If this option is set to `false`, then the underlying stream can defer persisting the logging event to a later time.

#### Remarks

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

TextWriterAppender Class | log4net.Appender Namespace