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 rotation of the log file #958

Open
vladem opened this issue Jul 30, 2024 · 0 comments
Open

Support rotation of the log file #958

vladem opened this issue Jul 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@vladem
Copy link
Contributor

vladem commented Jul 30, 2024

Tell us more about this new feature.

When --log-directory CLI flag is provided Mountpoint will write its logs to a file in the specified directory. Mountpoint will open the file once and use obtained file handle forever. If the original file was renamed, logs will still go to this file. If the file was deleted, logs will be lost.

Currently, it's possible to rotate the log file by truncating it, e.g. by using copytruncate option of logrotate. There is a small risk of not recording logs arriving during this operation.

This feature request is to add support of log rotation to Mountpoint, which will ensure that no data is lost. There are a couple of options of doing that, namely:

  1. just re-open the log file on SIGHUP (delegating the actual rotation to external tools);
  2. rotation performed by Mountpoint with a configurable policy (frequency, max log file size).

We'll likely want to ensure that our implementation is compatible with cloudwatch-agent.

@vladem vladem added the enhancement New feature or request label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant