Closed rpiesnikowski closed 7 years ago
Hi @rpiesnikowski ,
From your examples you seem to be using the default Serilog RollingFile sink:
.WriteTo.RollingFile(@"C:\temp\OAuthSTS.log", Serilog.Events.LogEventLevel.Verbose, fileSizeLimitBytes: 2048
This sink is actually created using .WriteTo.RollingFileAlternate
, you can see the example in the readme here: https://github.com/BedeGaming/sinks-rollingfile#file-size-limit. We've used this in production for over a year now with log files rolling over on size fine.
Hi @AndyWardle Indeed you was right. Change to RollingFileAlternate solve my problems. Thanks for helping
Hi, Basically I was wondering whether I can make RollingFile similar to logrotate in that manner that after file exceed n bytes new file will be created. So I started testing with very small values and saw that rollingFile only store first n bytes and skip next log information. I'm using .net core 1.1 under windows 7. I used this values to test RollingFile:
If I'm right and this is a bug, so this also mean that after reach 1GB of log each day, no more logs will be collected in RollingFile??
To compare I've two sinks File - this is configured in json (as final solution), and RollingFile (in code for test)
And for RollingFile:
Also I've put dispose: true
Finally output directory is: