Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No rotation if size limit hits maximum #24

Open
fuzolan opened this issue Jun 5, 2018 · 7 comments
Open

No rotation if size limit hits maximum #24

fuzolan opened this issue Jun 5, 2018 · 7 comments

Comments

@fuzolan
Copy link

fuzolan commented Jun 5, 2018

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
Copy link
Member

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

@firstyuyu
Copy link

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

@firstyuyu
Copy link

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 is true
  • rollingInterval: the default value is RollingInterval.Day

The nuget packet is here
The forked repo is here

@MikeRavenelle
Copy link

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

@nblumhardt
Copy link
Member

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

@kgrodimov
Copy link

@nblumhardt Hello, I made pr about it, can you review please? #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants