Skip to content

RotatingFileAppender #858

@CfirTsabari

Description

@CfirTsabari

Is your feature request related to a problem? Please describe.
I want to supply logs to the application that I write by using tracing, tracing-subscriber, and tracing-appender, but it's crucial to enforce small log files and a boundary to the total size of all the logs.
Small files - since its easier to read.
Total size - since disk space might be limited.

Describe the solution you'd like
I propose creating another Rotation
that will be based on size instead of time.
this rotation will be a configuration of two parameters:

  • The max size of each file
  • The maximum number of logs files to keep.

This rotation will create a new file every time the current file exceeds the allowed size and will bump all current old files indexes. In case the maximum number of files is reached it will delete the oldest file.

Describe alternatives you've considered
The current time-based rotation is not enough since it might vary a lot even in the apps.

Additional context
Python RotatingFileHandler

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate/appenderRelated to the `tracing-appender` crate.kind/featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions