Click or drag to resize

SetupLoadConfigurationExtensionsWriteToFile Method

Write to FileTarget

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public static ISetupConfigurationTargetBuilder WriteToFile(
	this ISetupConfigurationTargetBuilder configBuilder,
	Layout fileName,
	Layout layout = null,
	Encoding encoding = null,
	LineEndingMode lineEnding = null,
	bool keepFileOpen = true,
	bool concurrentWrites = false,
	long archiveAboveSize = 0,
	int maxArchiveFiles = 0,
	int maxArchiveDays = 0
)

Parameters

configBuilder
Type: NLog.ConfigISetupConfigurationTargetBuilder
Fluent interface parameter.
fileName
Type: NLog.LayoutsLayout
layout (Optional)
Type: NLog.LayoutsLayout
Override the default Layout for output
encoding (Optional)
Type: System.TextEncoding
Override the default Encoding for output (Default = UTF8)
lineEnding (Optional)
Type: NLog.TargetsLineEndingMode
Override the default line ending characters (Ex. LF without CR)
keepFileOpen (Optional)
Type: SystemBoolean
Keep log file open instead of opening and closing it on each logging event
concurrentWrites (Optional)
Type: SystemBoolean
Activate multi-process synchronization using global mutex on the operating system
archiveAboveSize (Optional)
Type: SystemInt64
Size in bytes where log files will be automatically archived.
maxArchiveFiles (Optional)
Type: SystemInt32
Maximum number of archive files that should be kept.
maxArchiveDays (Optional)
Type: SystemInt32
Maximum days of archive files that should be kept.

Return Value

Type: ISetupConfigurationTargetBuilder

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ISetupConfigurationTargetBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also