I'm using .Net Core 3.1 Application which is API. Due to below code, I'm able to generate example.txt log file however unable to delete this. "The process cannot access the file '' because it is being used by another process w3p".
Log.Logger = (new LoggerConfiguration())
.MinimumLevel.Information()
.MinimumLevel.Override("SerilogDemo", LogEventLevel.Information)
.WriteTo.File("C:\\Logs\\Example.txt",
restrictedToMinimumLevel:LogEventLevel.Information,
fileSizeLimitBytes: 2000,
retainedFileCountLimit:5,
rollOnFileSizeLimit:true ),
.CreateLogger();