You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to have a logfile header consisting of some comment lines explaining the used format (own formatter funtion).
I tried to use the open event but that is fired too late. I only don't know if it is fired on each file open (not as good) or if a new file is started (better),
My solution so far looks like (CoffeeScript);
trans = new winston.transports.DailyRotateFile # or File
level: 'info'
filename: "#{__dirname}/log/#{filename}"
formatter: myFormatter
trans.on 'open', ->
trans._stream.write "# MY LOGFILE HEADER\n"
logger = new winston.Logger
transports: [trans]
If I run this I will get:
INFO the real log entry
# MY LOGFILE HEADER
INFO another entry
INFO another entry
You see this comes one line too late.
Have you a better solution?
The text was updated successfully, but these errors were encountered:
The DailyRotateFile transport was moved to a separate module (winston-daily-rotate-file) as of winston@2.0.0. As such we are closing issues here and tracking their status in a single tracking issue in the new repository.
I want to have a logfile header consisting of some comment lines explaining the used format (own formatter funtion).
I tried to use the
open
event but that is fired too late. I only don't know if it is fired on each file open (not as good) or if a new file is started (better),My solution so far looks like (CoffeeScript);
If I run this I will get:
You see this comes one line too late.
Have you a better solution?
The text was updated successfully, but these errors were encountered: