Closed abhishek-v-github closed 4 months ago
That means that another handle to that file has been opened with exclusive permissions. The shared
flag doesn't allow to bypass OS-level restrictions, it merely ensures that the logger itself doesn't acquire and exclusive lock. Does this only occur when using the Async sink?
.NetCore 3.1 - File cannot be opened after staring a application. Error: File cannot be used because it is being used by another process.
loggerFactory.AddSerilog(); Log.Logger = new LoggerConfiguration().MinimumLevel.Information() .WriteTo.Async( o => o.File("test1.txt", shared: true)).CreateLogger(); app.UseSerilogRequestLogging();