[SERVER-9282] Audit tools for correct handling of log output Created: 08/Apr/13 Updated: 11/Jul/16 Resolved: 11/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.3 |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Shaun Verch | Assignee: | Shaun Verch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The logging output in the tools is inconsistent and may cause issues in certain situations. For example, in dump.cpp and export.cpp, all output is always sent to log() which uses stdout. This is a problem because mongodump and mongoexport can send actual data to stdout. To fix this, we need to always check the variable _usesstdout from tool.cpp to optionally send log messages to stderr. However, some tools use stderr for informational and log messages when it is actually not necessary. Mongorestore does this. In these cases, log messages should go to stdout instead. Also, as described in Finally, I think it might be good to make a test to make sure that the --quiet option actually silences all info messages, and to make sure that there aren't any logging messages that interfere with data sent to stdout. |
| Comments |
| Comment by auto [ 11/Oct/13 ] |
|
Author: {u'username': u'Zarkantho', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}Message: |
| Comment by Samantha Ritter (Inactive) [ 03/Oct/13 ] |
|
Added a comment about mongorestore. In more detail: > mongorestore --db digg out.bson This command is not sending data to stdout, so informational messages should be routed to stdout. Instead, they go to stderr. sverch explained that this might be related to code that is shared between mongorestore and bsondump, where using stderr is hard-coded in. |