loggit icon indicating copy to clipboard operation
loggit copied to clipboard

Add rotate_lines to .config and rotate logs automatically

Open psolymos opened this issue 3 years ago • 1 comments

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.

psolymos avatar Apr 11 '22 17:04 psolymos

Yep, no auto-rotate is implemented so loggit can be as efficient as possible. #21's implementation is a nice idea though, taking my comments there!

ryapric avatar Apr 12 '22 17:04 ryapric