Table of Contents

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

filePath string

Path to the log file.

maxFileSizeMB int

Maximum file size in MB before rotation (default: 10MB).

maxFiles int

Maximum 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

string

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

entry LogEntry

The log entry to write.