0

I'm trying to set up Serilog to match what the team is used to, but it seems that the rolling file behavior in unexpected. We want the FancyApp.log file to always include the latest log entries, but older log entries (when the file size rolls over the limit of say 1GB) should roll over to FancyApp.log.1 (or something simiar).

So far it seems to me that Serilog decides to first log all entries to FancyApp.log, then when that file is full, it writes the newest log entries to FancyApp.log.1, then .log.2 and so on.

Is it possible to tell Serilog to retain the newest entries in the .log file and push older entries into the log.1, log.2 files?

gakera
  • 3,589
  • 4
  • 30
  • 36
  • Does this answer your question? [How roll Serilog text files similar to log4net?](https://stackoverflow.com/questions/62744926/how-roll-serilog-text-files-similar-to-log4net) – Ruben Bartelink Jun 30 '23 at 13:42
  • While your question has different example naming, the suggested dup links to the relevant Serilog issue. TL;DR no, there are no rippling renames in serilog.sinks.file, and likely won;t be. But there is an alternate sink. And plenty explanation for why not – Ruben Bartelink Jun 30 '23 at 13:43

0 Answers0