configures serilog retained file count
All checks were successful
PiwigoDirectorySync/pipeline/head This commit looks good
All checks were successful
PiwigoDirectorySync/pipeline/head This commit looks good
This commit is contained in:
parent
5123b59f70
commit
baa0117e1e
@ -14,14 +14,13 @@ using Spectre.Console.Cli;
|
|||||||
const string outputTemplateConsole = "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}: {Message}{NewLine}";
|
const string outputTemplateConsole = "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}: {Message}{NewLine}";
|
||||||
const string outputTemplateFile = "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message}{NewLine}{NewLine}{Exception}{NewLine}";
|
const string outputTemplateFile = "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message}{NewLine}{NewLine}{Exception}{NewLine}";
|
||||||
|
|
||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration().MinimumLevel.Debug()
|
||||||
.MinimumLevel.Debug()
|
|
||||||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
||||||
.MinimumLevel.Override("System", LogEventLevel.Warning)
|
.MinimumLevel.Override("System", LogEventLevel.Warning)
|
||||||
.MinimumLevel.Override("Piwigo.Client", LogEventLevel.Warning)
|
.MinimumLevel.Override("Piwigo.Client", LogEventLevel.Warning)
|
||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.WriteTo.Console(LogEventLevel.Information, outputTemplateConsole, theme: AnsiConsoleTheme.Code)
|
.WriteTo.Console(LogEventLevel.Information, outputTemplateConsole, theme: AnsiConsoleTheme.Code)
|
||||||
.WriteTo.File("logs/PiwigoDirectorySync.txt", LogEventLevel.Debug, outputTemplate:outputTemplateFile, rollingInterval: RollingInterval.Day)
|
.WriteTo.File("logs/PiwigoDirectorySync.txt", LogEventLevel.Debug, outputTemplateFile, rollingInterval: RollingInterval.Day, retainedFileCountLimit: 90)
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
var registrations = new ServiceCollection();
|
var registrations = new ServiceCollection();
|
||||||
|
Loading…
Reference in New Issue
Block a user