Skip to content

Add rotate_lines to .config and rotate logs automatically #20

@psolymos

Description

@psolymos

Thanks for the great tool. As far as I can see in the source code, the log files are not automatically rotated. I would suggest the following implementation:

  • add a rotate_lines=NULL entry to the .config environment
  • have functions to set_rotate_lines and get_rotate_lines
  • loggit can check if .config$rotate_lines is set, and if it is set to non-NULL, rotate the logs

This would leave the implementation backwards compatible, but would allow using {loggit} in long running sessions where rotate_lines limit is likely to be exceeded, e.g. Plumber APIs etc.

I am happy to work on a PR if this is something you can see as a useful contribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions