5
Node.js-日志记录/使用Morgan和Winston
我们用于morgan记录快速转换: var morgan = require('morgan'); morgan('combined'); // a format string morgan(':remote-addr :method :url :uuid'); // a custom function morgan(function (req, res) { return req.method + ' ' + req.url + ' ' + req.uuid; }) 另外,我们winston为了记录其他日志记录而使用: var winston = require('winston'); var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)({ level: …