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

log_rotate_max_files is only checked on exceeding log_rotate_duration or log_rotate_bytes #10912

Closed
h3yduck opened this issue Jul 20, 2021 · 2 comments
Labels

Comments

@h3yduck
Copy link
Contributor

h3yduck commented Jul 20, 2021

Nomad version

Nomad v1.1.2 (60638a086ef9630e2a9ba1e237e8426192a44244)

Operating system and Environment details

Tested on macOS Big Sur 11.1 (20C69), but it should apply to all operating systems/environments.

Issue

log_rotate_max_files is only applied if:

  1. There is a log line written and
  2. log_rotate_duration or log_rotate_bytes is exceeded.

Reproduction steps

Given a client.hcl with contents of:

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

When

for i in {1..20}; do nomad agent -config client.hcl & sleep 5 && kill $!; done

is ran then

ls /tmp/log|wc -l

should return

Expected Result

8 (log_rotate_max_files specifies the maximum number of older log file archives to keep, not including the log file currently being written)

Actual Result

20

@h3yduck
Copy link
Contributor Author

h3yduck commented Oct 23, 2021

Fixed by #11070.

@h3yduck h3yduck closed this as completed Oct 23, 2021
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant