Log everything to database

I’m debugging my home IoT network, which is based mostly on MQTT traffic. For this, I am currently just dumping all messages (including $SYS) to a file, with timestamps, but this is not enough - I would need to dump also corresponding IP addresses and delivery of higher QoS messages. For this, I’m now using TCPDump, but it is a bit overkill.

Is there a way to dump whole Mosquitto broker activity to a database (no matter, what is the database style)? By activity I would mean e.g.

  • clients subscribing, to which topics, with client IP address and client name
  • clients posting, with client IP address and client name
  • QoS levels
  • keep-alives
  • delivery of 1 and 2 QoS level messages

Hi tuulos,

If you configure log_type all then you will see protocol level log messages, i.e. PUBLISH, PINGREQ, SUBSCRIBE, etc. The initial connection log message has the IP address and client id in, subsequent log messages just have the client id.

Is that sufficient for you?