qq_花开花谢_0
var fs = require(“fs”);// create a write stream (in append mode)var accessLogStream = fs.createWriteStream(’/data/logs/node/access.log’, {flags: ‘a’})// setup the loggerapp.use(morgan(‘combined’, {stream: accessLogStream}))上面代码的结果是所有日志内容都存储在access.log里,不像nginx生成的log自动分割