日志记录
本页内容
临时替代方案
我们正在开发一个新的日志框架。在此期间,您可以使用以下代码片段输出监控事件
const uri = "mongodb+srv://<user>:<password>@<cluster-url>?writeConcern=majority"; const client = new MongoClient(uri, { monitorCommands:true }); client.on('commandStarted', (event) => console.debug(event)); client.on('commandSucceeded', (event) => console.debug(event)); client.on('commandFailed', (event) => console.debug(event));