Skip to content

Mqtt Broker Log

DodaTech 1 min read

In this tutorial, you'll learn about EMQX Logs Not Showing Debug Information. We cover key concepts, practical examples, and best practices.

The Problem

EMQX log level is too high, missing useful debug messages.

Quick Fix

Wrong

# Default log level = warning — too high for debugging
No detailed message flow or connection information in logs.
# Change log level to debug (runtime)
emqx_ctl log set-level debug

# Or via emqx.conf
# log {
#   console_handler {
#     enable = true
#     level = debug
#   }
#   file_handlers {
#     default {
#       enable = true
#       level = debug
#       file = '${EMQX_LOG_DIR}/emqx.log'
#     }
#   }
# }

# Restart and tail logs
sudo systemctl restart emqx
sudo journalctl -u emqx -f
Detailed DEBUG logs showing MQTT packet flow, connections, and disconnections.

Prevention

Log levels: emergency, alert, critical, error, warning, notice, info, debug. Use debug only for troubleshooting — it generates high volume. Rotate logs: emqx.conf log.file_handlers.default.rotation. Use journalctl on systemd platforms. For production, set level to notice or warning.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### Where are EMQX logs stored?

Default: /var/log/emqx/. On systemd: sudo journalctl -u emqx. Docker: docker logs emqx.

Can I log to different files per log level?

Yes. Configure multiple file handlers with different levels. Filter by log type (MQTT, session, etc.) using the log.formatter.

Does debug logging affect performance?

Yes. Debug logging can reduce throughput by 10-30%. Use only for brief debugging sessions.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro