I'm using serilog in my ASP Core 2.2 application. Everything works great but I can't set flushToDiskInterval. It means that I want to flush logs to disk every minute for example but logs are flushed just as they're created. My Program.cs file:
public class Program
{
public static void Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.WriteTo.File("Logs/log-{Date}.txt", buffered: true, flushToDiskInterval: TimeSpan.FromSeconds(60))
.CreateLogger();
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseSerilog() // Set serilog as the logging provider.
.UseStartup<Startup>();
}
So the question is how to set the interval?
==UPDATE==
I can't understand that but now everything works fine... I checked and there is really flush interval set.