Reputation: 26313
I understand how to use mongodb.conf to set logpath to log to a file or to stdout, but is there a way to log to both? E.g. pipe stdout to a log file?
Upvotes: 3
Views: 1851
Reputation: 7552
You can use the tee command in UNIX:
/opt/mongodb/bin/mongod | tee mongod.log
If mongodb logs to stdout tee "copies" all output to the file mongod.log.
Upvotes: 3