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

--quiet flag does not suppress logged info messages for tools

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.3
    • Affects Version/s: 2.5.3
    • Component/s: Tools
    • Labels:
    • ALL

      The --quiet flag suppresses some informational messages, such as those thrown from tool.cpp:

      "connected to: 127.0.0.1"
      "file out.bson empty, skipping"

      Some tools seem to also throw informational messages using the log() function. These messages are not suppressed by the --quiet flag. In some cases, these messages are going to stdout when data is also being written to that stream, and could corrupt the data.

      mongodump --> with --quiet, this message goes to stdout:
      "2013-10-01T11:05:29.223-0400 DATABASE: digg to dump/digg"
      https://github.com/mongodb/mongo/blob/master/src/mongo/tools/dump.cpp#L193

      mongorestore --> with --quiet, these messages go to stdout:
      2013-10-01T11:23:53.629-0400 out.bson
      2013-10-01T11:23:53.629-0400 going into namespace [digg.out]
      2013-10-01T11:23:53.629-0400 out.metadata.json not found. Skipping.

      mongoimport --> with --quiet, these messages go to stdout
      2013-10-01T11:47:36.204-0400 check 0 0
      2013-10-01T11:47:36.205-0400 imported 0 objects

      Also related is a problem with mongofiles. Mongofiles seems to output some informational messages using cout.

      mongofiles --> with --quiet, these messages go to stdout
      added file:

      { _id: ObjectId('524d998f2c42a74c3cc1d84e'), filename: "mongofile.txt", chunkSize: 262144, uploadDate: new Date(1380817295498), md5: "d41d8cd98f00b204e9800998ecf8427e", length: 0 }

      done!

            Assignee:
            sverch Shaun Verch
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: