ZoneMTA emits logs over UDP in MessagePack format, so a MessagePack parser is needed to read log messages
npm install msgpack-js
Edit your ZoneMTA application config to activate remote UDP logging. Add remote
to the log
section. Port and host should point to the server where logger.js app is running.
{
"log": {
"syslog": ...,
"level": ...,
"remote": {
"protocol": "udp4",
"host": "127.0.0.1",
"port": 31239
}
}
}
Logging app should listen on the UDP port specified in ZoneMTA log.remote.port config
See the below for logger.js
Run the logging app
node logger.js
You should see the following output if everything worked:
Log server listening on port 31239
Once ZoneMTA does something with messages it should send the transaction info to this logger. The payload should be loged to console.
This is great. I can adapt this plugin to send GrayLog messages in GELF format. The plugin system you wrote is magic.