Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] send pushed messages to syslog


On Mon, Mar 16, 2020 at 3:37 PM Leandro Roggerone <ingrogger@xxxxxxxxx> wrote:
Hi guys , I would like to keep trap on pushed messages in my broker.
Currently I created a mosquitto_sub process that listen for all topics and send  messages to syslog daemon.
I wonder ... is there any better solution ?
Perhaps , some config directive  ...

IMO, adding functionality to the broker that is easily provided externally just makes the software potentially buggier.   Once I started running mosquitto, I added this:

[Unit]
Description=log mqtt stuff

[Service]
RestartSec=1
Restart=always
StartLimitInterval=0
WorkingDirectory=/home/dustin
ExecStart=/home/dustin/go/bin/logexec -tag mqtt /usr/bin/mosquitto_sub -v -i mqttlog -t '#'

[Install]
WantedBy=default.target
 
(logexec is a thing I wrote that I use for stuff like this)

This has been working flawlessly for a long time.

Back to the top