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

Rotate active log file on agent restart #11379

Closed
h3yduck opened this issue Oct 23, 2021 · 3 comments · Fixed by #11386
Closed

Rotate active log file on agent restart #11379

h3yduck opened this issue Oct 23, 2021 · 3 comments · Fixed by #11386
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/logging type/enhancement

Comments

@h3yduck
Copy link
Contributor

h3yduck commented Oct 23, 2021

Proposal

Before #11070, logs of the Nomad agent were rotated on restart, given a client configuration like this:

log_file             = "/tmp/log/"
log_rotate_max_files = 7

Starting from v1.1.4, the active log file is simply overwritten (its only rotated if the specified size/number of log files are exceeded).

This makes debugging problems a bit harder locally, I propose enabling log rotation of the active file on client startup as well (not sure if this should be the default or if its should be an opt-in behaviour).

Note: I'm not sure if this is the intended behaviour since this use-case is not clearly documented (hence I tagged this as a feature request instead of a bug).

Use-cases

Keeping logs for the last few client runs helps with debugging. I usually ssh into the node where the client is running if something really goes south, iterating on possible fixes while checking both the active and previous log files on the local filesystem (instead of checking a global log collector which is usually slower).

@lgfa29 lgfa29 added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/logging labels Oct 26, 2021
@lgfa29
Copy link
Contributor

lgfa29 commented Oct 26, 2021

Thanks for the report @h3yduck! I've raised a PR to fix this issue.

@h3yduck
Copy link
Contributor Author

h3yduck commented Oct 26, 2021

Thank you very much for fixing this @lgfa29! 🙂🙇

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/logging type/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants