[SERVER-33555] mongo --quiet does not silence initial connection messages Created: 28/Feb/18  Updated: 14/Apr/21  Resolved: 01/Mar/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.6.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andre Spiegel Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-27159 shell logs output of ReplicaSetMonito... Closed
Operating System: ALL
Participants:

 Description   

When using the --quiet option, the mongo shell still writes initial connection messages to stdout, when connecting via a replica set URL. These messages should be completely suppressed when the --quiet option is used, and even when they are not suppressed, they should be written to stderr rather than stdout.

$ mongo --quiet "mongodb://localhost:27017/?replicaSet=rsx" --eval "print('test')"
2018-02-28T20:52:31.450+0000 I NETWORK  [thread1] Starting new replica set monitor for rsx/localhost:27017
2018-02-28T20:52:31.451+0000 I NETWORK  [thread1] Successfully connected to localhost:27017 (1 connections now open to localhost:27017 with a 5 second timeout)
2018-02-28T20:52:31.451+0000 I NETWORK  [thread1] changing hosts to rsx/amz-play:27017 from rsx/localhost:27017
2018-02-28T20:52:31.451+0000 I NETWORK  [thread1] Successfully connected to amz-play:27017 (1 connections now open to amz-play:27017 with a 5 second timeout)
test



 Comments   
Comment by Nestor Urquiza [ 14/Apr/21 ]
... | grep -v 'I NETWORK'
Generated at Thu Feb 08 04:33:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.