serilog / serilog-extensions-logging-file

Add file logging to ASP.NET Core apps in one line of code.
Apache License 2.0
154 stars 42 forks source link

No rotation if size limit hits maximum #24

Open fuzolan opened 6 years ago

fuzolan commented 6 years ago

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.

nblumhardt commented 5 years ago

I think we might look into enabling rollOnFileSizeLimit: true in this package :+1:

firstyuyu commented 3 years ago

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

nblumhardt commented 3 years ago

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!

firstyuyu commented 3 years ago

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.

The nuget packet is here The forked repo is here

MikeRavenelle commented 2 years ago

Is there an update on officially implementing this in the main repo?

nblumhardt commented 2 years ago

@MikeRavenelle none at this point - a PR would be welcome if anyone is interested in taking a closer look.

kgrodimov commented 1 year ago

@nblumhardt Hello, I made pr about it, can you review please? https://github.com/serilog/serilog-extensions-logging-file/pull/60