jmcdo29/ogma

[Logger]: File log rotation

sschneider-ihre-pvs opened this issue · 5 comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

Missing log rotation option.

Describe the solution you'd like

It would be great if there would be a configurable log rotation option for saving to file system

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

keeping track of logs from different days or size

Ogma was written to be very open and plug-n-playable with any stream you like. You can use something like rotating-file-stream as the stream and it'll work for you 😄

By default, ogma writes out to process.stdout. If you're writing to a file, the logic to rotate between files falls to the developer. It's my opinion that the logger should be in charge of writing the logs, but the destination should fall to configuration so that it's not locked in

great suggestion with roating file stream 👍

@sschneider-ihre-pvs Were you able to get this working with rotating-file-stream? If so can you share the code. I would like to integrate into my own project.

I have not.