Class RotatingFileLogProvider
A Log provider that writes logs to daily log files.
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class RotatingFileLogProvider : LogProvider
Constructors
RotatingFileLogProvider(LogLevel, String, Int32)
Creates a new instance of the RotatingFileLogProvider.
Declaration
public RotatingFileLogProvider(LogLevel level, string logDirectory, int daysToKeep)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | level | The level at which to log at. |
System.String | logDirectory | The directory where the logs will be stored. |
System.Int32 | daysToKeep | How many days to keep logs. |
RotatingFileLogProvider(String)
Creates a new instance of the RotatingFileLogProvider. Defaults to LogLevel.Info, and 7 days.
Declaration
public RotatingFileLogProvider(string logDirectory)
Parameters
Type | Name | Description |
---|---|---|
System.String | logDirectory | The directory where the logs will be stored. |
RotatingFileLogProvider(String, Int32)
Creates a new instance of the RotatingFileLogProvider using DefaultLogLevel
Declaration
public RotatingFileLogProvider(string logDirectory, int daysToKeep)
Parameters
Type | Name | Description |
---|---|---|
System.String | logDirectory | The directory where the logs will be stored. |
System.Int32 | daysToKeep | How many days to keep logs. |
Properties
DaysToKeep
Gets how many days of files to keep.
Declaration
public int DaysToKeep { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
LogDirectory
Gets where to store the log files.
Declaration
public string LogDirectory { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
DoLog(LogEvent)
Logs a message at the specified log level.
Declaration
protected override void DoLog(LogEvent logEvent)
Parameters
Type | Name | Description |
---|---|---|
LogEvent | logEvent | The log event details. |