Closed RMHogervorst closed 4 years ago
Sure, I can see use for that, especially if a lot of logs are being written out.
Maybe a rotator function that notifies that logs are "stale", based on a user-defined period, and an argument to write old logs somewhere else or delete them? Even call it logrotate()
, for the sake of *nix consistency.
In the meantime, you can use the latest dev version's get_logs()
, and filter/write them out. Cumbersome, but will be addressed when the above is introduced.
rotate_logs()
will now handle this in v2.0.0. It will technically be a performance risk, as well as being manually-invoked (to alleviate those performance issues), but better automation of that might come in a later minor-version bump.
This is now done, tested, and documented. Onus of rotation logic will be on the developer to trigger in their own code, to keep loggit
as unobtrusive as possible.
Hi Ryan,
Is there a way to set rotating logs? Loggit appends now, but wouldn't it be nice if you could rotate the logs?