File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
src/Serilog.Enrichers.Memory/Enrichers Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ namespace Serilog.Enrichers
2323 /// </summary>
2424 public class MemoryUsageEnricher : ILogEventEnricher
2525 {
26- LogEventProperty _cachedProperty ;
27-
2826 /// <summary>
2927 /// The property name added to enriched log events.
3028 /// </summary>
@@ -37,8 +35,7 @@ public class MemoryUsageEnricher : ILogEventEnricher
3735 /// <param name="propertyFactory">Factory for creating new properties to add to the event.</param>
3836 public void Enrich ( LogEvent logEvent , ILogEventPropertyFactory propertyFactory )
3937 {
40- _cachedProperty = _cachedProperty ?? propertyFactory . CreateProperty ( MemoryUsagePropertyName , GC . GetTotalMemory ( false ) ) ;
41- logEvent . AddPropertyIfAbsent ( _cachedProperty ) ;
38+ logEvent . AddPropertyIfAbsent ( propertyFactory . CreateProperty ( MemoryUsagePropertyName , GC . GetTotalMemory ( false ) ) ) ;
4239 }
4340 }
4441}
You can’t perform that action at this time.
0 commit comments