From 83558ad5d3dc9da2c2e15d0112d1e2a4dc81fd85 Mon Sep 17 00:00:00 2001 From: zoka-cz <46539740+zoka-cz@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:15:23 +0200 Subject: [PATCH] * Explicitly specifying FileShare.Read option when opening the file stream (#72) Co-authored-by: Michal Linhart --- src/NReco.Logging.File/FileLoggerProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NReco.Logging.File/FileLoggerProvider.cs b/src/NReco.Logging.File/FileLoggerProvider.cs index 12abcc4..61e26e9 100644 --- a/src/NReco.Logging.File/FileLoggerProvider.cs +++ b/src/NReco.Logging.File/FileLoggerProvider.cs @@ -217,7 +217,7 @@ void createLogFileStream(bool append) { // so there is no need for a "manual" check first. fileInfo.Directory.Create(); - LogFileStream = new FileStream(LogFileName, FileMode.OpenOrCreate, FileAccess.Write); + LogFileStream = new FileStream(LogFileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read); if (append) { LogFileStream.Seek(0, SeekOrigin.End); } else {