How to use the config function from winston
Find comprehensive JavaScript winston.config code examples handpicked from public code repositorys.
20 21 22 23 24 25 26 27 28 29 30 31
process.env.NODE_ENV = 'development'; const filename = path.join('./', 'combined.log'); const logger = winston.createLogger({ levels: winston.config.syslog.levels, format: winston.format.combine(winston.format.colorize(), winston.format.timestamp({format: 'YYYY-MM-DD HH:mm:ss'}), winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`)), transports: [ new winston.transports.File({ filename: filename,
0
0
1
+ 20 other calls in file
GitHub: AstrahFNR/datafactory
73 74 75 76 77 78 79 80 81 82 83 84
let message = ts + ' ' + level + ': ' + (undefined !== options.message ? options.message : '') + (options.meta && Object.keys(options.meta).length ? '\n\t' + util.inspect(options.meta) : ''); if (options.colorize === 'all') { return winston.config.colorize(options.level, message); } return message; } }
0
0
1
winston.format is the most popular function in winston (1147 examples)