I recently updated to Mongoose 4, and now mongoose logs all of my queries in this format:
Mongoose: repostevents.find({ day: { '$gt': new Date("Sun, 13 Nov 2016 22:16:22 GMT") }, completed: false, userID: 143155925 }, { fields: undefined })
I want to turn off these logs.
I have tried the recommended solutions:
mongoose.set('debug', false);
and
mongoose.set('debug', function(collectionName, method, query, doc) {});
which change nothing.
These log messages are getting really annoying because I run large batch queries on my database which floods my log files with useless query logs.
JohnnyHK was correct in his comment. After doing a search, I found that there were several locations where another developer had written:
mongoose.set('debug',true);
I should have asked the other developer or done a full project search.
I could not turn off the logs. Although I used the command to search:
grep -ri "goose.set" ~/
Command showed all the references, wiping them it unfortunately did not help in my case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With