[SERVER-10989] --quiet flag does not suppress logged info messages for tools Created: 01/Oct/13  Updated: 11/Jul/16  Resolved: 23/Oct/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.5.3
Fix Version/s: 2.5.3

Type: Bug Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-10885 mongodump produces invalid bson when ... Closed
is related to SERVER-10886 tools with direct db access can produ... Closed
Operating System: ALL
Participants:

 Description   

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!



 Comments   
Comment by Shaun Verch [ 23/Oct/13 ]

Should be resolved as part of SERVER-10885 and SERVER-10886

Comment by Samantha Ritter (Inactive) [ 01/Oct/13 ]

Part of this issue is covered by SERVER-10886. I think there are two separate problems at hand:

1. Informational messages are sometimes going to stdout instead of stderr, which risks corruption of data, but is covered by SERVER-10886.
2. Informational messages are not all suppressed by the --quiet flag.

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