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

support 'logrotate' file naming/target strategy #179

Closed
neilwashere opened this issue Oct 5, 2020 · 2 comments
Closed

support 'logrotate' file naming/target strategy #179

neilwashere opened this issue Oct 5, 2020 · 2 comments

Comments

@neilwashere
Copy link

The logrotate facility on many unix systems will move the target log file with an incrementing integer suffix:

eg `my.log' -> 'my.log.1'

The application will continue writing to 'my.log' which has now been recreated (It expects the supplying application to recreate the target file or logrotate can be instructed to create).

Having a single target file makes configuring consuming applications less troublesome. At the moment I am trying to
use fluentbit with a file consumer but require that the target file is rotated. I can't do this with the file rotation offered
by this sink. Unfortunately using the actual logrotate utility against files being written to by this sink is suboptimal - it
requires that the target file be truncated in-situ as moving/creating is not a possibility due to how the file is being
handled. This can lead to data loss (and ends up misreporting the target file size negating the usefulness of logrotation to
address disk usage).

I wonder if there is any appetite to change the file rotation strategy of this sink to make it more unix (logrotate) friendly.

@bartelink
Copy link
Member

There's an issue covering the bulk of this desire in #40

@nblumhardt
Copy link
Member

https://github.com/dfacto-lab/serilog-sinks-file is the work-in-progress, for anyone interested in helping this along or trying it out 👍

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

3 participants