Search code examples
mongodbubuntuloggingsyslogrsyslog

Cannot write mongo db logs to syslog


I wish to redirect the mongodb.log to syslog. Any help will be useful?

I used the systemLog: destination: syslog systemFacility: mongodb

in mongodb.conf and tried restarting mongo db. But it does not writes anything to syslog.


Solution

  • while starting your mongo service you can define the log path with 'logpath' i.e.

    mongod --logpath /path/.../name.log