Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4729

Query params are no longer included in slow query hits to MongoDB logs

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.4, 2.1.1
    • Affects Version/s: 2.0.2
    • Component/s: Logging
    • Labels:
    • Environment:
      Ubuntu Linux 11.04/.10
    • ALL

      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

            Assignee:
            brandon Brandon Diamond
            Reporter:
            jasonmccay Jason McCay
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: