winstonjs / winston-daily-rotate-file

A transport for winston which logs to a rotating file each day.
MIT License
889 stars 151 forks source link

Ability to write headers to newly created file #385

Closed quintesse closed 9 months ago

quintesse commented 9 months ago

We're using the daily transport to write .csv formatted files (this is just the easiest format for the analysis tools we're using) and we'd really like the ability to write the CSV column headers as the first line of each file.

Possible solutions might be to either have an option like header where we could set a fixed string that would get added as the first line of a new file.

On the other hand, perhaps this is already possible using the events?

quintesse commented 9 months ago

Responding to my own issue: this does indeed seem to be possible using the "new" event. Closing.