Class FileLogger
Inherited Members
Namespace: Estrelica.Logging
Assembly: Estrelica.Logging.dll
Syntax
public class FileLogger : BaseLogger, ILogSubscriber
Constructors
FileLogger(string, int, LogLevel, TimestampFormat)
Creates a new instance of FileLogger
Declaration
public FileLogger(string filenameTemplate = null, int retentionDays = 0, LogLevel minimumSubscribedLevel = LogLevel.Info, FileLogger.TimestampFormat timestampFormat = TimestampFormat.None)
Parameters
string
filenameTemplate
A filename where log events may be saved. If a relative path is provided, the full filename will be resolved relative to the current operating directory. Template strings in the filename will be replaced as follows: {TIMESTAMP} - The current local date/time in yyyy_MM_dd_HH_mm_ss format {APPNAME} - The name of the entry assembly. If null, this defaults to "{APPNAME}_{TIMESTAMP}.log" |
int retentionDays |
LogLevel minimumSubscribedLevel |
FileLogger.TimestampFormat
timestampFormat
If not None, each line in the output will be prefaced by the date and/or time in Local or UTC format |
Properties
Description
Filename
Methods
Cleanup(Action<string>)
Declaration
[DoNotObfuscate]
public void Cleanup(Action<string> responseCallback)
Parameters
Action<string> responseCallback |
DoLog(string, LogLevel)
Declaration
protected override void DoLog(string message, LogLevel level)
Parameters
string message |
LogLevel level |
Overrides
~FileLogger()
Declaration
protected ~FileLogger()
Subscribe(string, int, LogLevel)
Declaration
[DoNotObfuscate]
public static FileLogger Subscribe(string logFilenameTemplate = null, int retentionDays = 0, LogLevel minimumLevel = LogLevel.Info)
Parameters
string logFilenameTemplate |
int retentionDays |
LogLevel minimumLevel |
Returns
FileLogger |