Homebrew services - how to stream its log?

If I run a command line service like mongod , my terminal window will continue to show its log output. If i run it as a homebrew service, which is what mongodb itself recommends for mac, with command brew services start mongodb-community, I won't get any log output.

How do i continually stream the log? For mongod, or other homebrew services?


Solution 1:

The mongodb-community service logs to the following places:

$HOMEBREW_PREFIX/var/log/mongodb/mongo.log
$HOMEBREW_PREFIX/var/log/mongodb/output.log

Usually this means that they're located in:

/usr/local/var/log/mongodb/

You can continually stream the logs using a command like this in the Terminal:

tail -f /usr/local/var/log/mongodb/*.log