-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bug: log-rotate max_kept doesn't work if enable_compression: true #8343
Comments
Any error in the |
Seems like no.
|
https://github.com/apache/apisix/blob/master/apisix/plugins/log-rotate.lua#L179 The code itself didn't check if compression was enabled when cleaning up old files here. In the very first code of this feature, it's correct. Please have a check on it. Thanks |
The logic is correct:
|
I'll try to reproduce your problem |
The logic is correct only if
|
I don't know what you mean '.tar.gz' suffix is hardcoded, the file compressed is renamed before (https://github.com/apache/apisix/blob/master/apisix/plugins/log-rotate.lua#L227), and it just add a suffix (.tar.gz) here, it's full name likes: 2022-11-18_13-49-06__access.log.tar.gz |
几个命令很容易复现,你试下吧。另外,测试用例里没有覆盖到 max-kept 跟 enable_compression: true 的场景 |
OK, the |
Sorry. I'm not familiar with Lua, maybe someone here can help to fix this issue? |
And it would be great if |
Description
Update the
example/apisix_conf/config.yaml
to:And then start the docker-compose.
The number of files (*.tar.gz) in the
example/apisix_log/
directory will grow without limit.I want to keep only the X most recent tar.gz files while enable_compression: true, but the current configuration cannot take effect.
The text was updated successfully, but these errors were encountered: