Dam*_*ran 3 debugging mongoose node.js express
我将mongoose调试设置为true.
mongoose.set('debug',true)
但是现在调试日志是在console中打印的.我需要为mongoose debug指定一个单独的文件,以便我可以在需要时检查查询.我该怎么做?
小智 11
伟大的aaron heckmann在Logging outbound查询中回答了这个问题
mongoose.set('debug', function (collectionName, method, query, doc [, options]) { //save to file what you need });
归档时间:
13 年,1 月 前
查看次数:
4563 次
最近记录:
12 年,2 月 前