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

Roll buffer files on size/limit total disk usage in durable mode #92

Merged
merged 9 commits into from
Oct 19, 2017

Conversation

nblumhardt
Copy link
Member

#52 highlights some problems in per-day buffer files when log volumes are high.

This PR takes advantage of the new functionality in Serilog.Sinks.File 4.0 to roll buffer files on 100 MB boundaries, so that space can be reclaimed within the one day period.

The PR is breaking - slightly - in that the parameter previously called bufferFileSizeLimitBytes has been renamed to bufferSizeLimitBytes and is applied to the whole file set instead of individual files. By doing this, we can better control disk usage, and ensure the oldest data is discarded when the limit is reached.

    .WriteTo.Seq("http://localhost:5341",
                 bufferBaseFilename: "logs/buffer",
                 bufferSizeLimitBytes: 1_000_000_000)

In practice the change in semantics shouldn't have a huge negative impact - the behavior upon hitting the old limit was undesirable, so the value is usually set high.

…g.Sinks.File)

Changes the semantics of the parameter previously called bufferFileSizeLimitBytes - this is now bufferSizeLimitBytes and is applied to the whole file set.
@nblumhardt nblumhardt merged commit 78e0d80 into datalust:dev Oct 19, 2017
@nblumhardt nblumhardt changed the title Roll buffer files on size in durable mode Roll buffer files on size/limit total disk usage in durable mode Oct 21, 2017
@nblumhardt nblumhardt mentioned this pull request Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant