# Log everything to database

**URL:** <https://forum.cedalo.com/t/log-everything-to-database/371>\
**Category:** Broker management and monitoring\
**Created:** [October 28, 2021, 9:31am UTC](https://forum.cedalo.com/t/log-everything-to-database/371 "2021-10-28T09:31:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuulos](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tuulos](https://forum.cedalo.com/u/tuulos)\
**Post date:** [October 28, 2021, 9:31am UTC](https://forum.cedalo.com/t/log-everything-to-database/371/1 "2021-10-28T09:31:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roger.light](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@roger.light](https://forum.cedalo.com/u/roger.light)\
**Post date:** [October 28, 2021, 10:08am UTC](https://forum.cedalo.com/t/log-everything-to-database/371/2 "2021-10-28T10:08:37Z")

</div>

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?

Regards,

Roger
