mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Fix missing logs
This commit is contained in:
@@ -31,9 +31,14 @@ namespace BTCPayServer
|
||||
var logger = loggerFactory.CreateLogger("Configuration");
|
||||
try
|
||||
{
|
||||
// This is the only way toat LoadArgs can print to console. Because LoadArgs is called by the HostBuilder before Logs.Configure is called
|
||||
var conf = new DefaultConfiguration() { Logger = logger }.CreateConfiguration(args);
|
||||
if (conf == null)
|
||||
return;
|
||||
Logs.Configure(loggerFactory);
|
||||
new BTCPayServerOptions().LoadArgs(conf);
|
||||
Logs.Configure(null);
|
||||
/////
|
||||
|
||||
host = new WebHostBuilder()
|
||||
.UseKestrel()
|
||||
@@ -64,6 +69,8 @@ namespace BTCPayServer
|
||||
finally
|
||||
{
|
||||
processor.Dispose();
|
||||
if(host == null)
|
||||
Logs.Configuration.LogError("Configuration error");
|
||||
if (host != null)
|
||||
host.Dispose();
|
||||
loggerProvider.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user