Type: Logging Extension
Version: 1.0.1
License: Apache License Version 2.0
The HiveMQ MQTT Message Log Extension is a very useful HiveMQ Extension for debugging and development purposes. It provides the possibility to follow up on any clients communicating with the broker on the terminal.
The extension logs the following events:
-
A client connects to HiveMQ
-
A client sends a publish message
-
A client sends a subscribe message
-
A client disconnects from HiveMQ
-
HiveMQ sends a publish message to a client
-
HiveMQ Enterprise 4.2.0 or later
-
Or the current master branch of the HiveMQ Community Edition
-
Download HiveMQ Mqtt Message Log Extension
-
Move the file: "hivemq-mqtt-message-log-extension-1.0.1.zip" to the directory: "HIVEMQ_HOME/extensions"
-
-
Or clone this repository into a Java 11 maven project
-
run
mvn package
goal from Maven to build the extension. -
Move the file: "hivemq-mqtt-message-log-extension-1.0.1-distribution.zip" to the directory: "HIVEMQ_HOME/extensions"
-
-
Unzip the file.
-
Start HiveMQ.
It is possible to opt out of specific log event types by adding a mqttMessageLog.properties files to your <HIVEMQ_HOME>/hivemq-mqtt-message-log-extension folder. There is an example file available which removes the logging of publish messages. Just rename it to mqttMessageLog.properties
If you set verbose to true, all MQTT messages are logged with all the information available. Otherwise only basic information like client id, topic, qos and payload will be logged. See examples.
This properties file could have the following entries:
-
client-connect=false|true
-
client-disconnect=false|true
-
publish-received=false|true
-
publish-send=false|true
-
subscribe-received=false|true
-
verbose=false|true
Caution
|
use verbose=true very carefully as it will flood your log immediately. |
Missing entries default to true. verbose defaults to false.
Connect with an MQTT client of your choice. You should see a log message with its client identifier, MQTT version, clean start flag and session expiry interval.
"17:26:23.602 INFO - Received CONNECT from client 'clientid': Protocol version: 'V_5', Clean Start: 'false',
Session Expiry Interval: '10000', Keep Alive: '20000', Maximum Packet Size: '40000',
Receive Maximum: '30000', Topic Alias Maximum: '50000', Request Problem Information: 'true',
Request Response Information: 'false', Username: 'the username', Password: 'the password',
Auth Method: 'auth method', Auth Data (Base64): 'YXV0aCBkYXRh',
User Properties: [Name: 'name0', Value: 'value0'], [Name: 'name1', Value: 'value1'],
Will: { Topic: 'willtopic', Payload: 'payload', QoS: '1', Retained: 'false', Message Expiry Interval: '1234',
Duplicate Delivery: 'false', Correlation Data: 'data', Response Topic: 'response topic',
Content Type: 'content type', Payload Format Indicator: 'UTF_8', Subscription Identifiers: '[1, 2, 3, 4]',
User Properties: [Name: 'name0', Value: 'value0'], [Name: 'name1', Value: 'value1'],
[Name: 'name2', Value: 'value2'], Will Delay: '100' }"
If you want to contribute to HiveMQ Mqtt Message Log Extension, see the contribution guidelines.
HiveMQ Mqtt Message Log Extension is licensed under the APACHE LICENSE, VERSION 2.0
. A copy of the license can be found here.