如何使用express-winston
记录发送到 Parse Server 的所有 http 请求?
我试过这个:
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
const app = express();
const winston = require('winston')
const expressWinston = require('express-winston');
app.use(expressWinston.logger({
transports: [
new winston.transports.Console()
],
format: winston.format.combine(
winston.format.colorize(),
winston.format.json()
)
}));
app.use('/parse', new ParseServer({
// ...
}));
const httpServer = require('http').createServer(app);
httpServer.listen(1337);
但是控制台中没有日志输出express-winston
。
这里缺少什么?