Class FileTextLogWriter
Implementation of ILogWriter for logging into a file.
public sealed class FileTextLogWriter : TextLogWriter, ILogWriter, IDisposable
- Inheritance
-
FileTextLogWriter
- Implements
- Inherited Members
Constructors
FileTextLogWriter(string?, bool)
Initializes a new instance of the FileTextLogWriter class.
public FileTextLogWriter(string? fileName = null, bool append = true)
Parameters
fileName
stringLog file name
you can use placeholders for: - ProcessId: "{{proc_id}}"
; - UtcNow:"{{timestamp}}"
;Defaults to "{{proc_id}}_{{timestamp}}.log"
append
booltrue to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file.
Properties
TextWriter
Current TextWriter
protected override TextWriter TextWriter { get; }
Property Value
Methods
GetLogFileWriter(string?, bool)
Return a log file stream writer
public static StreamWriter GetLogFileWriter(string? fileName = null, bool append = true)