| SetupLoadConfigurationExtensionsWriteToFile Method |
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
)
<ExtensionAttribute>
Public Shared Function WriteToFile (
configBuilder As ISetupConfigurationTargetBuilder,
fileName As Layout,
Optional layout As Layout = Nothing,
Optional encoding As Encoding = Nothing,
Optional lineEnding As LineEndingMode = Nothing,
Optional keepFileOpen As Boolean = true,
Optional concurrentWrites As Boolean = false,
Optional archiveAboveSize As Long = 0,
Optional maxArchiveFiles As Integer = 0,
Optional maxArchiveDays As Integer = 0
) As ISetupConfigurationTargetBuilder
Dim configBuilder As ISetupConfigurationTargetBuilder
Dim fileName As Layout
Dim layout As Layout
Dim encoding As Encoding
Dim lineEnding As LineEndingMode
Dim keepFileOpen As Boolean
Dim concurrentWrites As Boolean
Dim archiveAboveSize As Long
Dim maxArchiveFiles As Integer
Dim maxArchiveDays As Integer
Dim returnValue As ISetupConfigurationTargetBuilder
returnValue = configBuilder.WriteToFile(fileName,
layout, encoding, lineEnding, keepFileOpen,
concurrentWrites, archiveAboveSize,
maxArchiveFiles, maxArchiveDays)
[<ExtensionAttribute>]
static member WriteToFile :
configBuilder : ISetupConfigurationTargetBuilder *
fileName : Layout *
?layout : Layout *
?encoding : Encoding *
?lineEnding : LineEndingMode *
?keepFileOpen : bool *
?concurrentWrites : bool *
?archiveAboveSize : int64 *
?maxArchiveFiles : int *
?maxArchiveDays : int
(* Defaults:
let _layout = defaultArg layout null
let _encoding = defaultArg encoding null
let _lineEnding = defaultArg lineEnding null
let _keepFileOpen = defaultArg keepFileOpen true
let _concurrentWrites = defaultArg concurrentWrites false
let _archiveAboveSize = defaultArg archiveAboveSize 0
let _maxArchiveFiles = defaultArg maxArchiveFiles 0
let _maxArchiveDays = defaultArg maxArchiveDays 0
*)
-> ISetupConfigurationTargetBuilder
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:
ISetupConfigurationTargetBuilderUsage 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