diff --git a/libraries/src/AWS.Lambda.Powertools.Logging/Internal/PowertoolsLogger.cs b/libraries/src/AWS.Lambda.Powertools.Logging/Internal/PowertoolsLogger.cs index 27d7d613..e723ed22 100644 --- a/libraries/src/AWS.Lambda.Powertools.Logging/Internal/PowertoolsLogger.cs +++ b/libraries/src/AWS.Lambda.Powertools.Logging/Internal/PowertoolsLogger.cs @@ -40,6 +40,11 @@ internal sealed class PowertoolsLogger : ILogger /// The name /// private readonly string _name; + + /// + /// The current configuration + /// + private LoggerConfiguration _currentConfig; /// /// The Powertools for AWS Lambda (.NET) configurations @@ -77,7 +82,7 @@ public PowertoolsLogger( powertoolsConfigurations, systemWrapper, getCurrentConfig); _powertoolsConfigurations.SetExecutionEnvironment(this); - CurrentConfig = GetCurrentConfig(); + _currentConfig = GetCurrentConfig(); if (_lambdaLogLevelEnabled && _logLevel < _lambdaLogLevel) { @@ -87,7 +92,7 @@ public PowertoolsLogger( } } - private LoggerConfiguration CurrentConfig { get; set; } + private LoggerConfiguration CurrentConfig => _currentConfig ??= GetCurrentConfig(); /// /// Sets the minimum level. @@ -370,7 +375,7 @@ private object GetFormattedLogEntry(LogLevel logLevel, DateTime timestamp, objec /// internal void ClearConfig() { - CurrentConfig = null; + _currentConfig = null; } /// diff --git a/version.json b/version.json index d83c948c..ebe82eef 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "Core": { - "Logging": "1.4.3", + "Logging": "1.4.4", "Metrics": "1.5.3", "Tracing": "1.3.2" },