Click or drag to resize

FileTargetKeepFileOpen Property

Gets or sets a value indicating whether to keep log file open instead of opening and closing it on each logging event.

Namespace:  NLog.Targets
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public bool KeepFileOpen { get; set; }

Property Value

Type: Boolean
Remarks
KeepFileOpen = true gives the best performance, and ensure the file-lock is not lost to other applications.
KeepFileOpen = false gives the best compability, but slow performance and lead to file-locking issues with other applications.
See Also