Click or drag to resize

SetupLoadConfigurationExtensionsWriteToFile Method (ISetupConfigurationTargetBuilder, Layout, Layout, Encoding, LineEndingMode, Boolean, Boolean, Int64, Int32, Int32)

Write to FileTarget

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 5.5.0+1873145cbc26e0312d9481234d69ce7dc68aac4e
Syntax
public static ISetupConfigurationTargetBuilder WriteToFile(
	this ISetupConfigurationTargetBuilder configBuilder,
	Layout fileName,
	Layout layout,
	Encoding encoding,
	LineEndingMode lineEnding,
	bool keepFileOpen,
	bool concurrentWrites,
	long archiveAboveSize = -1,
	int maxArchiveFiles = -1,
	int maxArchiveDays = -1
)

Parameters

configBuilder
Type: NLog.ConfigISetupConfigurationTargetBuilder
Fluent interface parameter.
fileName
Type: NLog.LayoutsLayout
layout
Type: NLog.LayoutsLayout
Override the default Layout for output
encoding
Type: System.TextEncoding
Override the default Encoding for output (Default = UTF8)
lineEnding
Type: NLog.TargetsLineEndingMode
Override the default line ending characters (Ex. LF without CR)
keepFileOpen
Type: SystemBoolean
Keep log file open instead of opening and closing it on each logging event
concurrentWrites
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