serilog-extensions-logging-file
serilog-extensions-logging-file copied to clipboard
No rotation if size limit hits maximum
My expectation is that a new file should be written if the size limit reaches the maximum. Instead log-messages are lost.
I use the component in a asp core 2 project. Configuration is in appsettings.json.
I think we might look into enabling rollOnFileSizeLimit: true
in this package :+1:
I think we might look into enabling
rollOnFileSizeLimit: true
in this package 👍
Hi @nblumhardt
This is exactly what I need. I am new to Serilog and I have read source code of this repo but cannot find (or don't know) how to put rollOnFileSizeLimit: true
. Could you show me, where it should be put? Therefore, I can make my own fork and add that feature. This discussion is old and it seems that this feature request will not be implemented soon.
Thanks
Hi @firstyuyu - it should be here I believe:
https://github.com/serilog/serilog-extensions-logging-file/blob/dev/src/Serilog.Extensions.Logging.File/Microsoft/Extensions/Logging/FileLoggerExtensions.cs#L146
HTH!
Hi @firstyuyu - it should be here I believe:
https://github.com/serilog/serilog-extensions-logging-file/blob/dev/src/Serilog.Extensions.Logging.File/Microsoft/Extensions/Logging/FileLoggerExtensions.cs#L146
HTH!
Hi @nblumhardt ,
Thanks. For anyone who face this issue, I have forked this repo and add two optional parameters on AddFile
extension method.
-
rollOnFileSizeLimit
: the default value istrue
-
rollingInterval
: the default value isRollingInterval.Day
Is there an update on officially implementing this in the main repo?
@MikeRavenelle none at this point - a PR would be welcome if anyone is interested in taking a closer look.