Hive MQ Logging : Assistance Required

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 :

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

Thank you @Daria_H ,

Appreciate the asssitance. :slight_smile:
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!

See screenshot below:

:slight_smile: 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

Hi Team

I require some assistance regarding the log extension please.

Whenever we restart our docker container the log extension gets removed. How do we prevent that or what other ways can we try to keep the log extension?

Any help, guidance and advice is appreciated

Thanks
Hendrew

Hi @Hendrew ,

Thank you for your interest in HiveMQ. We’re delighted to have you as part of our community!

Regarding your inquiry, we kindly request further clarification on the specific extension you are referring to. Are you referring to the MQTT Message Log Extension found at HiveMQ Extension - MQTT Message Log?

Additionally, it would be greatly appreciated if you could provide us with more details on how you currently run HiveMQ in a Docker container. Please include the following information:

  1. The exact command you use to run HiveMQ.
  2. If you are utilizing a custom Docker image, please share the Dockerfile.
  3. If you are running HiveMQ via docker-compose, kindly provide us with your docker-compose.yml configuration file.

By providing us with these details, we will be able to offer you suitable guidance on integrating the extension into your Docker container.

We appreciate your cooperation.

Kind regards,
Dasha from HiveMQ Team

Hi Dasha

Thanks for getting back to me.

Can I organize a MS Teams call for us sometime please? I think that might be a bit easier and quicker.

Thanks
Hendrew

Hey @Hendrew ,

Thank you for your inquiry. Currently, on-call support is exclusively available to our esteemed HiveMQ customers. If you are a customer, we kindly request you to submit a support request through our Customer Support Portal at support.hivemq.com. Our dedicated support team will promptly assist you in resolving any issues or queries you may have.

If you are not a HiveMQ customer, we encourage you to utilize this community forum to share the information you require.

Usually, if you have Docker running on your laptop, you can effortlessly run HiveMQ with any extensions by adding the extension’s directory as a Docker volume. Here’s a step-by-step guide:

  1. Download the extension zip file and unzip it to a directory of your choice.
  2. Customize the configuration according to your needs.
  3. Specify the path to the extension’s directory in the docker-compose.yml file as demonstrated below:
version: "3.5"
services:
  hivemq:
    image: hivemq/hivemq4:latest
    container_name: hivemq
    environment:
      - HIVEMQ_LOG_LEVEL=DEBUG
    ports:
      - "1883:1883"
      - "8080:8080"
    volumes:
      - path/to/my/hivemq-mqtt-message-log-extension:/opt/hivemq/extensions/hivemq-mqtt-message-log-extension
    networks:
      - hivemq_net

networks:
  hivemq_net:

  1. Run in Docker and utilize the docker-compose.yml file:
docker-compose -f path/to/my/docker-compose.yml up

Please note that the sample docker-compose.yml file assumes that you have already installed Docker and have the necessary permissions to execute Docker commands.

I hope this guidance proves helpful. If you require any further assistance, please don’t hesitate to ask. We’re here to help!

Best regards,
Dasha from HiveMQ Team