[SERVER-7818] With 'logpath' set in mongodb.conf, even `mongod --help` prints to log file Created: 03/Dec/12  Updated: 09/Sep/14  Resolved: 09/Sep/14

Status: Closed
Project: Core Server
Component/s: Usability
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Stuart Montgomery Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X Mountain Lion 10.8.2, installed via Homebrew


Issue Links:
Related
is related to SERVER-6900 Windows Service: --install output sho... Closed
Operating System: ALL
Steps To Reproduce:

1. Set these in mongodb.conf:

logpath = /Volumes/Data/Users/stuart/.homebrew/var/log/mongodb/mongo.log
logappend = true

2. Run `mongod --help` or `mongod --version` and observe that these commands log to the log file, making the usage hard to find.

Participants:

 Description   

I installed MongoDB via Homebrew, and it set me up with a mongodb.conf file that includes:

  1. Append logs to /Volumes/Data/Users/stuart/.homebrew/var/log/mongodb/mongo.log
    logpath = /Volumes/Data/Users/stuart/.homebrew/var/log/mongodb/mongo.log
    logappend = true

When I went to get usage for the mongod CLI with `mongod --help`, it printed the usage itself to the log file. I would expect usage to be a special case that does not print to the log file even if it is set in the .conf, OR would perhaps print to both stdout and the log file.

Same goes for the --version option, probably.



 Comments   
Comment by Thomas Rueckstiess [ 09/Sep/14 ]

Tested this with 2.6.4 installed via brew and the behavior is now as it should be: mongod --help outputs to stdout, even when the logpath is specified.

Comment by Tad Marshall [ 03/Dec/12 ]

This is similar to SERVER-6900, where output from a console operation goes to the log file instead of to the console. I think we need to separate learning that we are using a log file from switching all output to going to it.

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