ASEWPER
February 22, 2023, 6:31pm
1
Hi, Can someone share insight as to how to configure logging on our Hive MQ.
Also can one also share insight as to where the log file will be stored?
Some info which might help :
Hive MQ is running in a docker container on a Linux Server
License type : industrial-edge-edition
Events which I require to be logged :
Daria_H
February 23, 2023, 8:32am
2
Hi @ASEWPER ,
Great to see your interest in MQTT and HiveMQ, welcome to the community!
Installation
$HIVEMQ_HOME
└── extensions
├── hivemq-mqtt-message-log-extension
├── LICENSE.txt
├── README.html
├── README.txt
├── hivemq-extension.xml
├── hivemq-mqtt-message-log-extension-1.1.0.jar
└── mqttMessageLog-example.properties
Rename the mqttMessageLog-example.properties
file to mqttMessageLog.properties
Modify the mqttMessageLog.properties
file for your needs. For example, to log everything:
#Log EVERYTHING
verbose=true
publish-received=true
publish-send=true
client-connect=true
connack-send=true
client-disconnect=true
subscribe-received=true
suback-send=true
unsubscribe-received=true
unsuback-send=true
ping-request-received=true
ping-response-send=true
puback-received=true
puback-send=true
pubrec-received=true
pubrec-send=true
pubrel-received=true
pubrel-send=true
pubcomp-received=true
pubcomp-send=true
MQTT messages will be logged to the $HIVEMQ_HOME/log/hivemq.log
file (a.k.a the broker log ).
I hope it helps.
Kind regards,
Dasha from HiveMQ Team
ASEWPER
February 23, 2023, 12:58pm
3
Thank you @Daria_H ,
Appreciate the asssitance.
I have tried this and can confirm that it works. Can you advise as to how I can exclude the PING REQUEST and PING RESPONSE messages from the logs?
Thanks in advance!
Daria_H
February 23, 2023, 1:07pm
5
after updating the mqttMessageLog.properties
file you can either restart the broker or disable and enable the extension.
Disable the extension:
touch $HIVEMQ_HOME/extensions/hivemq-mqtt-message-log-extension/DISABLED
sleep 10
Enable the extension:
rm $HIVEMQ_HOME/extensions/hivemq-mqtt-message-log-extension/DISABLED
I hope it helps
Kind regards,
Dasha from HiveMQ Team