mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 07:04:26 +01:00
Fix debug log not showing (Fix #1157)
This commit is contained in:
@@ -58,7 +58,16 @@ namespace BTCPayServer.Configuration
|
||||
|
||||
public static string GetDebugLog(IConfiguration configuration)
|
||||
{
|
||||
return configuration.GetValue<string>("debuglog", null);
|
||||
var logfile = configuration.GetValue<string>("debuglog", null);
|
||||
if (!string.IsNullOrEmpty(logfile))
|
||||
{
|
||||
if (!Path.IsPathRooted(logfile))
|
||||
{
|
||||
var networkType = DefaultConfiguration.GetNetworkType(configuration);
|
||||
logfile = Path.Combine(configuration.GetDataDir(networkType), logfile);
|
||||
}
|
||||
}
|
||||
return logfile;
|
||||
}
|
||||
public static LogEventLevel GetDebugLogLevel(IConfiguration configuration)
|
||||
{
|
||||
@@ -207,11 +216,6 @@ namespace BTCPayServer.Configuration
|
||||
|
||||
LogFile = GetDebugLog(conf);
|
||||
if (!string.IsNullOrEmpty(LogFile))
|
||||
{
|
||||
if (!Path.IsPathRooted(LogFile))
|
||||
LogFile = Path.Combine(DataDir, LogFile);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(LogFile))
|
||||
{
|
||||
Logs.Configuration.LogInformation("LogFile: " + LogFile);
|
||||
Logs.Configuration.LogInformation("Log Level: " + GetDebugLogLevel(conf));
|
||||
|
||||
Reference in New Issue
Block a user