33

I installed mongodb in my mac and following is the way I installed. Where is my mongodb log file located?

$ tar xzf mongodb-osx-x86_64-2.2.3.tgz
$ sudo mv mongodb-osx-x86_64-2.2.3 /usr/local/mongodb

$ sudo mkdir -p /data/db
$ sudo chown 'whoami' /data/db

$ vim .bash_profile

  export MONGO_PATH=/usr/local/mongodb
  export PATH=$PATH:$MONGO_PATH/bin

Where is the settings file of mongodb located which stores all this information.

raju
  • 331
  • 1
  • 3
  • 5

4 Answers4

52

I installed mongo with brew, and it was located at /usr/local/var/log/mongodb/mongo.log

I found it by running

find / -name mongo.log
Zoltán
  • 21,321
  • 14
  • 93
  • 134
18

From the mongo shell you can find the path for data, log and config using:

   db.serverCmdLineOpts()
luckyape
  • 722
  • 8
  • 22
3

With the default mongodb-community homebrew installation on a Macbook Pro with Apple Silicon, the logs are with the rest of the homebrew services logs, at /opt/homebrew/var/log. I think the location is different with Intel silicon, but the concept should be the same.

nachbar
  • 2,643
  • 1
  • 24
  • 34
2

As @dcrosta answered here: Sane defaults for MongoDB on OSX, MongoDB only have default values for the data path. All other locations shall be established by the user if desired.

In the installation process you posted here, can't see any command to set the log path so, in conclusion, your MongoDB is not saving any log file.

Community
  • 1
  • 1
CarlosRos
  • 389
  • 6
  • 15
  • 1
    Yes I didn't find conf file in /usr/local/mongodb/mongod.conf. How do I set those defaults then? – raju Dec 19 '14 at 11:23