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
filePathstringThe 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
filePathstringThe path of the log file.
overwriteboolSpecifies 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
disposingboolA 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
logEventLogEventThe log event to handle.