I am using winston to add log details in node.js, i used the following procedure to add the logs
var winston = require('winston');
winston.remove(winston.transports.Console);
winston.add(winston.transports.Console, {'timestamp':true,'colorize':true);
winston.log('info','jjjj');
the output that i got is
2012-12-21T09:32:05.428Z - info: jjjj
I need to specify a format for mytimestamp , is there any provision to do so in winston any help will be much appreciated
for a good result, you may use momentjs:
The timestamp option can be a function that returns what you wish it to be saved as...
Line 4:
Source here: https://github.com/flatiron/winston/pull/120
winston@3 version
To support timezone, you need to change
format
to a function which winston will call.