I am using serilog v1.5.1 (due to compatibility with .NET 4.0) and there is no CloseAndFlush() function. What is the alternative? It is generating the log file but not writing to it.
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File($"logs/log{timestamp}.txt", outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] {Message:lj}{NewLine}{Exception}")
.CreateLogger();
Log.Information("test!!");
Log.Logger.Information("Hello!");
CodePudding user response:
