public FileLoggerProvider(IOptionsMonitor <FileLoggerOptions> options) : base(options) { var loggerOptions = options.CurrentValue; _path = loggerOptions.LogDirectory; _fileName = loggerOptions.FileName; _maxFileSize = loggerOptions.FileSizeLimit; _maxRetainedFiles = loggerOptions.RetainedFileCountLimit; _rollingInterval = loggerOptions.RollingInterval; }
public static string GetFormat(this RollingIntervalEnum interval) { switch (interval) { case RollingIntervalEnum.Year: return("yyyy"); case RollingIntervalEnum.Month: return("yyyyMM"); case RollingIntervalEnum.Day: return("yyyyMMdd"); case RollingIntervalEnum.Hour: return("yyyyMMddHH"); case RollingIntervalEnum.Minute: return("yyyyMMddHHmm"); default: throw new ArgumentException("Invalid rolling interval"); } }
public static string GetFormat(this RollingIntervalEnum interval) { switch (interval) { case RollingIntervalEnum.Year: return("yyyy"); case RollingIntervalEnum.Month: return("yyyyMM"); case RollingIntervalEnum.Day: return("yyyyMMdd"); case RollingIntervalEnum.Hour: return("yyyyMMddHH"); case RollingIntervalEnum.Minute: return("yyyyMMddHHmm"); default: return(""); } }