1

I am trying to forward MongoDB logs from several remote servers to a central logging server. To do this, I changed my mongod.conf files to use syslog like so:

systemLog:
  destination: syslog
  syslogFacility: local3

I then configured rsyslog to forward messages like so:

if($syslogFacility-text == "local3") then{
  if($syslogTag contains "mongod") then{
    action(type="omfwd" target="MY.SYSLOG.SERVER.IP" port="PORT" protocol="udp")
    stop
  }
}

My logging server is configured to write any messages sent at that port to my central mongod.log file.

My question is; is there a better way to do this? For example, could I specify my logging server's IP/PORT in mongod.conf so I don't have to rely on each Mongo server's local rsyslog?

0

It does not seem like it. According to the manual, the systemlog.destination option only accepts file and syslog.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.