1

I am using Serilog in my .Net Core application with the following settings:

"flushToDiskInterval": "00:00:10",
"outputTemplate": "[{Timestamp:MM/dd/yyyy HH:mm:ss:fff}-{Level}]: {Message} - ({SourceContext:l}){NewLine}{Exception}",
"rollingInterval": "Day",
"retainedFileCountLimit": 31,
"fileSizeLimitBytes": 5242880, //5MB
"rollOnFileSizeLimit": "true"

With these settings, Serilog will create a new file daily and also when the previous file size is 5MB. Thus, in a day I can have multiple files depending on the logging intensity.

I will like to keep the log files generated pruned by date (not by the number of files) regardless of the number of files. Do I have to write a custom sink?

David Jiboye
  • 511
  • 8
  • 19

0 Answers0