Skip to content

bug: log-rotate max_kept doesn't work if enable_compression: true #8343

Description

@JohnsonCaii

Description

$ git clone https://github.com/apache/apisix-docker.git
$ cd apisix-docker/example

Update the example/apisix_conf/config.yaml to:

plugins:
    - log-rotate

plugin_attr:
  log-rotate:
    interval: 1    # rotate interval (unit: second)
    max_kept: 10     # max number of log files will be kept
    max_size: -1      # max size of log files will be kept
    enable_compression: true

And then start the docker-compose.

docker-compose -p docker-apisix -f docker-compose-arm64.yml up -d

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.

Metadata

Metadata

Assignees

Labels

checkingcheck first if this issue occurred

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions