Class FileLogHandler
Represents a log handler that writes log events to a file.
public class FileLogHandler : ILogHandler, IDisposable
- Inheritance
-
FileLogHandler
- Implements
- Inherited Members
Constructors
FileLogHandler(string)
Initializes a new instance of the FileLogHandler class with the specified file path.
public FileLogHandler(string filePath)
Parameters
filePath
stringThe path of the log file.
Exceptions
FileLogHandler(string, bool)
Initializes a new instance of the FileLogHandler class with the specified file path.
public FileLogHandler(string filePath, bool overwrite)
Parameters
filePath
stringThe path of the log file.
overwrite
boolSpecifies whether the file should be overwritten if it exists on the disk.
Exceptions
Methods
Dispose()
Disposes the file log handler and releases any resources used.
public void Dispose()
Dispose(bool)
Disposes the file log handler and releases any resources used.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolA flag indicating whether to dispose managed resources.
~FileLogHandler()
Finalizes the file log handler instance.
protected ~FileLogHandler()
Handle(LogEvent)
Handles a log event by writing it to the log file.
public void Handle(LogEvent logEvent)
Parameters
logEvent
LogEventThe log event to handle.