As the other answers said, it is likely that you have the "logpath" parameter made in the configuration file. If you don’t know where it is, you can find it by running mongod as:
sudo su - strace -e open mongod
This displays some information - each mongod file tries to open - in which you can find the configuration file. For me, it looked like this (in part):
… open("/proc/cpuinfo", O_RDONLY) = 3 open("/dev/urandom", O_RDONLY) = 3 open("/etc/mongodb.conf", O_RDONLY) = 4 all output going to: /var/log/mongodb/mongodb.log open("/var/log/mongodb/mongodb.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 4 open("/var/log/mongodb/mongodb.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 1 …
After you find the file, comment out (C #) the line logpath = and your log should be displayed on stdout.
source share