[SERVER-564] mongodump should be more quiet Created: 22/Jan/10  Updated: 12/Jul/16  Resolved: 15/Apr/10

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

Type: Improvement Priority: Minor - P4
Reporter: Slavi Pantaleev Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all?


Attachments: Text File tool.cpp.patch    
Issue Links:
Related
related to SERVER-4169 mongodump should be more quiet Closed
Participants:

 Description   

mongodump currently outputs a lot of things to stdout, which can be easily redirected when used in scripts.

The message "connected to: 127.0.0.1" is sent to stderr, which doesn't really make sense, because it's not an error.

I don't believe anything other than errors should be sent to stderr, especially from a tool that's supposed to be used mostly in automated environments.
This would cause sysadmins to:

1. Send everything to /dev/null, which would cause them to not know if anything breaks
2. Write output handling scripts to inspect the stderr output, which is an inconvenience

As far as I understand now, those messages are common to all the tools, and something might break if this gets changed.
A possible workaround would be to provide a `--quiet` switch, which would not output such messages.



 Comments   
Comment by Daniel Pasette (Inactive) [ 22/Feb/13 ]

There was a regression in the 1.8.x series and fixed again in 2.0.x here: SERVER-4169

Comment by NOVALUE Mitar [ 22/Feb/13 ]

mongodump 1.8.1. It is a bit old, but it is written above that it was fixed in 1.5.1.

Comment by Daniel Pasette (Inactive) [ 21/Feb/13 ]

which version are you using and please include your exact command line. i cannot reproduce this behavior in 2.0.4, 2.2.3 or 2.4.0-rc0

Comment by NOVALUE Mitar [ 11/Feb/13 ]

Exactly what is it written about:

The message "connected to: 127.0.0.1" is sent to stderr, which doesn't really make sense, because it's not an error.

So using -o to redirect the output and using >/dev/null to redirect stdout output (there really should be a quiet switch), I still get "connect to" on stderr, even if there is no error. So running mongodump in cron is not nice, because you are getting e-mails even if there are no errors.

Comment by Eliot Horowitz (Inactive) [ 11/Feb/13 ]

Mitar - can you open a new ticket what what you're seeing?

Comment by NOVALUE Mitar [ 10/Feb/13 ]

Yes, please reopen.

Comment by Roman Shtylman [ 28/Oct/11 ]

This is no longer fixed:
https://github.com/mongodb/mongo/blob/master/tools/dump.cpp#L40

This line passes 'false' for the last constructor argument to Tool and thus stderr is used once again.

Comment by auto [ 15/Apr/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: clean up stderr vs stdout for mongodump SERVER-564
http://github.com/mongodb/mongo/commit/8e50585bcf216a4210162f0a3b72aa2a38e61228

Comment by Mark Woods [ 13/Apr/10 ]

I modified tool.cpp (see attached patch) to send a few seemingly non-error outputs to stdout rather than stderr

Possibly not the right thing to do, but while this issue is outstanding, it's working for us.

We're running 1.5.0 btw

Generated at Thu Feb 08 02:54:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.