javascript - 如何使用 Express 设置日志记录级别?

标签 javascript node.js express

默认记录器会打印很多几乎无用的信息: app.use(express.logger());

有没有办法为快速记录器设置级别?

最佳答案

Since Express 4 , 你应该使用 Morgan .

npm install morgan

var morgan = require('morgan');
app.use(morgan('tiny'));

关于javascript - 如何使用 Express 设置日志记录级别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20182973/

相关文章:

javascript - 当窗口失去焦点时 Settimeout 不起作用

node.js - "composeEnhancers"不是 ReactJS 中的函数

node.js - Passport 中的req.isAuthenticated()和passport.authenticate()有什么区别?

node.js - 将图像文件从React前端上传到Node/Express/Mongoose/MongoDB后端(不起作用)

javascript - 表达 : typescript: Argument of type 'typeof <express.Router>' is not assignable to parameter of type 'RequestHandlerParams'

node.js - 如何在多个路由中使用nodejs提供静态文件

javascript - 传单JS : prevent clicking on map when clicking on circlemarker

javascript - JS、jQuery 冲突..有帮助吗?

javascript - 使用解析云代码从数组中删除对象

javascript - silverstripe-module yeoman 生成器中的 JS 意外 token 错误