Nodejs 应用部署小记
1、日志功能 1) 加入 access.log 1 2 3 4 5 var accessLogfile = fs.createWriteStream('access.log', {flags: 'a'}); app.configure(function() { app.use(express.logger({stream: accessLogfile})); } 2) 加入 error.log 首先,添加 helpers/error.js 文件: 1 2 3 4 5 6 7 8 9 10 11 12 var fs = require('fs'); var errorLogfile = fs.createWriteStream('logs/error.log', {flags: 'a'}); exports.handler = function(err, req, res, status) { console.log(err); var