MQTT Mosquitto Add On Logging

Hi, I am running Hass.io in docker. I am using the Mosquitto Broker Add-on. However it spams my /var/log/messages file like this whenever a connection is opened or closed:

Feb 19 08:58:36 raspberrypi b18da609c64e[846]: 1645261115: New connection from 192.168.178.112 on port 1883.
Feb 19 08:58:36 raspberrypi b18da609c64e[846]: 1645261115: Client M5ENV already connected, closing old connection.
Feb 19 08:58:36 raspberrypi b18da609c64e[846]: 1645261115: New client connected from 192....

Lots of clients constantly re-connect, whenever they send a new update (which can be every few seconds). How can I reduce the verbose level on logging? I only want to see warnings and errors (and I think a new connection should not be a warning). Optimally this should be possible to setup via the add-on configuration directly as everything runs inside of dockers and I don’t know how to create local config files that are visible from inside these add-ons. I do not see an option for this in the add on documentation:
https://github.com/home-assistant/addons/blob/8d01fd31f24f7e7916193b800eecd441e67f1bc8/mosquitto/DOCS.md
(except the customize.folder which I don’t know how to use).

Also this:
https://www.home-assistant.io/docs/mqtt/logging/

setting to :
homeassistant.components.mqtt: warning
or
homeassistant.components.mqtt: error

did not change anything at all.

Any help how to change the log level would be appreciated!

OK, solved it myself. I finally found where the customize files go when using hassio. I created:

/usr/share/hassio/share/mosquitto/mosquitto.conf

with:

log_type none
log_type error
log_type warning

also activated the Addon customization in the hassio web interface:

customize:
  active: true
  folder: mosquitto

Note: it was necessary to put log_type none as the first line in the config file, in order to first switch off all logging. The log_type is additive so only putting warning or error will not change anything as those are already logged!

Hope this helps someone.

1 Like