Class FileLogSink
- Namespace
- FlowGraph.Core.Diagnostics
- Assembly
- FlowGraph.Core.dll
Log sink that writes to a file with automatic rotation support.
public sealed class FileLogSink : ILogSink, IDisposable
- Inheritance
-
FileLogSink
- Implements
- Inherited Members
Constructors
FileLogSink(string, int, int)
Creates a new file log sink.
public FileLogSink(string filePath, int maxFileSizeMB = 10, int maxFiles = 5)
Parameters
filePathstringPath to the log file.
maxFileSizeMBintMaximum file size in MB before rotation (default: 10MB).
maxFilesintMaximum number of rotated files to keep (default: 5).
Properties
Name
Gets the name of this sink for identification purposes.
public string Name { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Flush()
Flushes any buffered log entries.
public void Flush()
Write(LogEntry)
Writes a log entry to this sink.
public void Write(LogEntry entry)
Parameters
entryLogEntryThe log entry to write.