node.js - Plain file logging in winston -
I just do not want to log in one data and log level, timestamp etc.
var logger = new (winston.Logger) ({transports: [new (winston.transports.File) ({filename: '/tmp/data.log', json: wrong, timestamp : Function () {return '';}}}]}); Logger.log ('info', 'a') This removes the timestamp from the line, but the log level still appears. Currently, the file has "info: a", I just want to log in "one", is it possible to specify the output format in Worthone?
Unfortunately, this formatting is fundamentally in Winston; You can see the logic for this in the log function in common.js , which is used by most default transport. The way this will write your own custom transport does not depend on common.log () . On one side: You only have to disable timestamp logging in a timestamp: false option default transport.
Comments
Post a Comment