Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 morgan 生成的所有“HTTP 请求”保存在数据库和 .txt 文件中?
我的 index.html:
const app = require('express')() const morgan = require('morgan') const db = require('./config/db') let x = app.use(morgan('dev')) console.log('x',x)
我无法打印变量 'x' ...
不确定将它们存储到数据库中。但是,您可以使用pm2 npm 存储在文件中。有关 pm2日志管理的更多详细信息。