mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Logs UI in Server Admin (#374)
* add in ui * add in logging viewer * Revert "add in ui" This reverts commit 9614721fa8a439f7097adca69772b5d41f6585d6. * finish basic feature * clean up * improve and fix build * add in debug log level command option * use paging for log file list, use extension to select log files, show message for setting up logging * make paging a little better * add very basic UT for logs * Update ServerController.cs
This commit is contained in:
committed by
Nicolas Dorier
parent
d152d5cd90
commit
c9c7316b7d
@@ -55,18 +55,15 @@ namespace BTCPayServer
|
||||
l.AddProvider(new CustomConsoleLogProvider(processor));
|
||||
|
||||
// Use Serilog for debug log file.
|
||||
string debugLogFile = conf.GetOrDefault<string>("debuglog", null);
|
||||
if (String.IsNullOrEmpty(debugLogFile) == false)
|
||||
{
|
||||
Serilog.Log.Logger = new LoggerConfiguration()
|
||||
var debugLogFile = BTCPayServerOptions.GetDebugLog(conf);
|
||||
if (string.IsNullOrEmpty(debugLogFile) != false) return;
|
||||
Serilog.Log.Logger = new LoggerConfiguration()
|
||||
.Enrich.FromLogContext()
|
||||
.MinimumLevel.Debug()
|
||||
.MinimumLevel.Is(BTCPayServerOptions.GetDebugLogLevel(conf))
|
||||
.WriteTo.File(debugLogFile, rollingInterval: RollingInterval.Day, fileSizeLimitBytes: MAX_DEBUG_LOG_FILE_SIZE, rollOnFileSizeLimit: true, retainedFileCountLimit: 1)
|
||||
.CreateLogger();
|
||||
|
||||
l.AddSerilog(Serilog.Log.Logger);
|
||||
logger.LogDebug($"Debug log file configured for {debugLogFile}.");
|
||||
}
|
||||
l.AddSerilog(Serilog.Log.Logger);
|
||||
})
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
Reference in New Issue
Block a user