[SERVER-4729] Query params are no longer included in slow query hits to MongoDB logs Created: 20/Jan/12  Updated: 11/Jul/16  Resolved: 02/Mar/12

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: 2.0.2
Fix Version/s: 2.0.4, 2.1.1

Type: Bug Priority: Major - P3
Reporter: Jason McCay Assignee: Brandon Diamond
Resolution: Done Votes: 3
Labels: logging
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu Linux 11.04/.10


Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

In 1.8.x and previous versions of MongoDB, when a slow query hit the logs, it would show the query, the time the query took and, most importantly, the params that were used in the query. This was great for quickly identifying issues without having to go through the process of turning on and tuning the profiling feature.

Also, in times of the database being busy, it is great to look at things from an outside perspective (logs vs. auth'ing into the db)

For example...

In 1.8.x the query may look like:
Fri Jan 20 05:48:19 [conn1923] query staging.addon.stats{data_size: {$gt: 500.0 }} nscanned:4485 reslen:20 2131ms

In 2.0.2 the query looks like:
Fri Jan 20 06:01:28 [conn22205] query staging.addon.stats nscanned:4485 reslen:20 2131ms

In testing, we had to move our file config settings on the MongoDB instance to vvv=true to get the details to appear in the logs. Of course, based on our tests on that verbosity level, all queries and their details hit the logs. So this is not optimal.

Can these params be added back to the logs?

Jason



 Comments   
Comment by auto [ 05/Mar/12 ]

Author:

{u'login': u'', u'email': u'brandon@10gen.com', u'name': u'Brandon Diamond'}

Message: SERVER-4729: log slow queries + improved test
Branch: v2.0
https://github.com/mongodb/mongo/commit/5899a6daa5170289b9db04a41670de7677acd03f

Comment by auto [ 09/Feb/12 ]

Author:

{u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}

Message: SERVER-4729: log slow queries + improved test
Branch: master
https://github.com/mongodb/mongo/commit/19bf4dbd9d632aaf3c91792e11ef6782f22f09c9

Comment by auto [ 07/Feb/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: Revert "SERVER-4729: Ensure query logged when slow"

This reverts commit a950ba5fc7e48a92120ac94dff16c0d2de657285.
Branch: master
https://github.com/mongodb/mongo/commit/f0e4452fdf583c321770d721c726d5d78e832ea5

Comment by auto [ 06/Feb/12 ]

Author:

{u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}

Message: SERVER-4729: Ensure query logged when slow
Branch: master
https://github.com/mongodb/mongo/commit/a950ba5fc7e48a92120ac94dff16c0d2de657285

Generated at Thu Feb 08 03:06:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.