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

Logging stops when bufferFileSizeLimitBytes is reached and there is no way to change it to {Hour} logs #52

Closed
corneliutusnea opened this issue Feb 8, 2017 · 5 comments

Comments

@corneliutusnea
Copy link

corneliutusnea commented Feb 8, 2017

So,

Sending logs to the SeqServer stops when the rolling buffer file reaches the value defined for bufferFileSizeLimitBytes parameter. So by default the logging will stop (hard stop with no way to recover) at 1Gb data / day send through the serilog sink.

The RollingFileSink seems to accept different file patterns (https://github.com/serilog/serilog-sinks-rollingfile/blob/dev/src/Serilog.Sinks.RollingFile/Sinks/RollingFile/Specifier.cs#L22) like Hour, HalfHour or Day but the SeriLog sink automatically configures the file to use -{Date} so the file size limit is set to the date (https://github.com/serilog/serilog-sinks-seq/blob/dev/src/Serilog.Sinks.Seq/Sinks/Seq/DurableSeqSink.cs#L58).

If I try to set the filename to "seqbuffer-{Hour}" for the RollingFileSync crashes because now I have two tokens {Hour} and {Date}.

  1. Is there a way (outside or configuring the file size to 5-10Gb to roll the files while sending the data to Seq?
  2. Can the -{Date} in the DurrableSeqSink maybe be removed or only appended if there is no other token?
@nblumhardt
Copy link
Member

Hi Corneliu, thanks for the note.

The only current option is to increase the buffer file size limit. Since the files aren't designed to be transported over the network, would there be a down-side to this? If the files rolled hourly, you'd still end up with the same disk utilization.

@corneliutusnea
Copy link
Author

@nblumhardt I'm not worried about the disk size. I'm worried that because they don't roll, even setting a limit of 2-3Gb can mean that at one point I might have an out-of-average busy-day when I'm at risk for the logs to simply stop with no way to recover.

@nblumhardt
Copy link
Member

You're right; I can see how finer-grained rolling files would help minimise disk usage while keeping things moving, by allowing old buffer files to be cleared out faster. I'll have a look at what this would take as soon as I have a chance 👍

@nblumhardt
Copy link
Member

Thinking about this some more, there really shouldn't be any reason to use {Date} as the default - {Hour} or even {HalfHour} would function the same way, but with less overhead. Would switching the whole thing over to {Hour} (with some tweaked limits) do the job?

We'd need to make sure it will gracefully roll over for existing implementations, and adjust some limits, but seems okay in theory.

The only real "gotcha" would be the change in semantics where a file size limit is already being specified...

nblumhardt added a commit to nblumhardt/serilog-sinks-seq that referenced this issue Oct 19, 2017
…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
Copy link
Member

@corneliutusnea I think we've finally got a good solution to this in #92 (WIP). If it's still an issue for you, thoughts/feedback on the PR would be great. Thanks again for the initial nudge on this, sorry it's taken a while.

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

2 participants