Skip to content

Commit bcda204

Browse files
authored
Merge pull request #522 from aws-powertools/develop
chore: sync main and develop
2 parents 7072019 + ce0de0f commit bcda204

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

libraries/src/AWS.Lambda.Powertools.Logging/Internal/PowertoolsLogger.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ internal sealed class PowertoolsLogger : ILogger
4040
/// The name
4141
/// </summary>
4242
private readonly string _name;
43+
44+
/// <summary>
45+
/// The current configuration
46+
/// </summary>
47+
private LoggerConfiguration _currentConfig;
4348

4449
/// <summary>
4550
/// The Powertools for AWS Lambda (.NET) configurations
@@ -77,7 +82,7 @@ public PowertoolsLogger(
7782
powertoolsConfigurations, systemWrapper, getCurrentConfig);
7883

7984
_powertoolsConfigurations.SetExecutionEnvironment(this);
80-
CurrentConfig = GetCurrentConfig();
85+
_currentConfig = GetCurrentConfig();
8186

8287
if (_lambdaLogLevelEnabled && _logLevel < _lambdaLogLevel)
8388
{
@@ -87,7 +92,7 @@ public PowertoolsLogger(
8792
}
8893
}
8994

90-
private LoggerConfiguration CurrentConfig { get; set; }
95+
private LoggerConfiguration CurrentConfig => _currentConfig ??= GetCurrentConfig();
9196

9297
/// <summary>
9398
/// Sets the minimum level.
@@ -370,7 +375,7 @@ private object GetFormattedLogEntry(LogLevel logLevel, DateTime timestamp, objec
370375
/// </summary>
371376
internal void ClearConfig()
372377
{
373-
CurrentConfig = null;
378+
_currentConfig = null;
374379
}
375380

376381
/// <summary>

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Core": {
3-
"Logging": "1.4.3",
3+
"Logging": "1.4.4",
44
"Metrics": "1.5.3",
55
"Tracing": "1.3.2"
66
},

0 commit comments

Comments
 (0)