Skip to content

Commit 10ff017

Browse files
committed
Refactor LoggerFileTarget to use instance locking for improved thread safety
1 parent a55b9ae commit 10ff017

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Falko.ZeroLogger.Targets.File/Targets/LoggerFileTarget.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public sealed class LoggerFileTarget : LoggerTarget
2121
private static readonly string ApplicationDirectory = AppDomain.CurrentDomain.BaseDirectory;
2222

2323
#if NET9_0_OR_GREATER
24-
private static readonly Lock Locker = new();
24+
private readonly Lock _locker = new();
2525
#else
26-
private static readonly object Locker = new();
26+
private readonly object _locker = new();
2727
#endif
2828

2929
private readonly string _directoryPath;

0 commit comments

Comments
 (0)