Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is log file of mongodb in mac

Tags:

macos

mongodb

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.

like image 205
raju Avatar asked Dec 19 '14 10:12

raju


People also ask

What is MongoDB log?

As part of normal operation, MongoDB maintains a running log of events, including entries such as incoming connections, commands run, and issues encountered. Generally, log messages are useful for diagnosing issues, monitoring your deployment, and tuning performance.

How do I open a MongoDB file on a Mac?

Once you are assured that your MongoDb directory has all the required permissions, open the terminal application on your Mac and type the command, ~/mongodb/bin/mongod to start the Mongo Server. In another terminal window, type the command ~/mongodb/bin/mongo in order to start the Mongo Shell.

Where can I find MongoDB errors?

Let's take a look at the latest format for MongoDB errors which you can find by looking at your MongoDB log file which is commonly located at /var/log/mongodb/mongodb. log . If the file's not there, you'll need to find your mongodb. conf file which specifies where your log file lives.


2 Answers

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 
like image 92
Zoltán Avatar answered Oct 22 '22 04:10

Zoltán


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

   db.serverCmdLineOpts() 
like image 25
luckyape Avatar answered Oct 22 '22 06:10

luckyape