mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2025-12-23 22:18:39 -05:00
Fix log level change not taking effect (#292)
This commit is contained in:
@@ -1173,6 +1173,9 @@ public class ConfigurationController : ControllerBase
|
||||
}
|
||||
}
|
||||
|
||||
// Handle logging configuration changes
|
||||
var loggingChanged = HasLoggingConfigurationChanged(oldConfig.Log, newConfig.Log);
|
||||
|
||||
newConfig.Adapt(oldConfig, config);
|
||||
|
||||
// Persist the configuration
|
||||
@@ -1185,9 +1188,6 @@ public class ConfigurationController : ControllerBase
|
||||
dynamicHttpClientFactory.UpdateAllClientsFromGeneralConfig(oldConfig);
|
||||
|
||||
_logger.LogInformation("Updated all HTTP client configurations with new general settings");
|
||||
|
||||
// Handle logging configuration changes
|
||||
var loggingChanged = HasLoggingConfigurationChanged(oldConfig.Log, newConfig.Log);
|
||||
|
||||
if (loggingChanged.LevelOnly)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ public static class LoggingConfigManager
|
||||
{
|
||||
using var context = DataContext.CreateStaticInstance();
|
||||
var config = context.GeneralConfigs.AsNoTracking().First();
|
||||
SetLogLevel(config.Log.Level);
|
||||
|
||||
const string categoryTemplate = "{#if Category is not null} {Concat('[',Category,']'),CAT_PAD}{#end}";
|
||||
const string jobNameTemplate = "{#if JobName is not null} {Concat('[',JobName,']'),JOB_PAD}{#end}";
|
||||
|
||||
Reference in New Issue
Block a user