Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hivemq/hivemq-community-edition/llms.txt
Use this file to discover all available pages before exploring further.
Logging Configuration
HiveMQ Community Edition uses Logback as its logging framework, providing flexible and powerful logging configuration capabilities.Default Configuration
HiveMQ ships with a default Logback configuration located at:- Console appender with formatted output
- INFO level logging for most components
- Special log levels for third-party libraries
- Migration warnings
Logback Configuration File
Default logback.xml
Log Levels
Available Log Levels
Logback supports the following log levels (from most to least verbose):- TRACE - Very detailed debugging information
- DEBUG - Detailed debugging information
- INFO - Informational messages (default)
- WARN - Warning messages for potentially problematic situations
- ERROR - Error messages for serious problems
- OFF - Disable logging
Default Log Levels
| Component | Level | Purpose |
|---|---|---|
| Root | INFO | Default for all HiveMQ components |
| migrations | WARN | Database migration warnings |
| jetbrains.exodus | WARN | Persistence library messages |
| org.eclipse.jetty | ERROR | HTTP server errors only |
| com.google.common.util.concurrent.Futures.CombinedFuture | OFF | Suppress Guava future warnings |
| oshi | ERROR | System metrics library errors |
Customizing Logging
Changing Log Levels
To enable debug logging for HiveMQ components:Component-Specific Logging
Enable detailed logging for specific components:Appenders
Console Appender
The default console appender outputs to standard output:%-30(%d %level)- Date and log level (left-aligned, 30 chars)%msg- Log message%n- Newline%ex- Exception stack trace (if present)
File Appender
To log to a file instead of console:Rolling File Appender
For production environments, use a rolling file appender:Async Appender
For high-throughput scenarios, wrap appenders with async appender:Pattern Formats
Common Pattern Elements
| Pattern | Description | Example |
|---|---|---|
%d | Date and time | 2024-03-15 14:30:45 |
%d{ISO8601} | ISO8601 format | 2024-03-15T14:30:45.123Z |
%level | Log level | INFO, DEBUG, ERROR |
%-5level | Log level (padded) | INFO , DEBUG |
%logger | Logger name | com.hivemq.bootstrap.HiveMQServer |
%logger{36} | Abbreviated logger | c.h.bootstrap.HiveMQServer |
%thread | Thread name | main, pool-1-thread-1 |
%msg | Log message | Actual log message |
%n | Newline | Platform-specific newline |
%ex | Exception | Full stack trace |
JSON Logging
For structured logging (useful with log aggregation tools):Requires adding
logstash-logback-encoder dependency to your HiveMQ setup.Dynamic Log Level Changes
Enable Configuration Scanning
Enable automatic configuration reload:Via JMX
Log levels can also be changed at runtime using JMX MBeans (if JMX is enabled).Troubleshooting
Enable Debug Logging
For troubleshooting issues:Common Debug Scenarios
Connection Issues:Best Practices
Production Logging
- Use INFO level for normal operations
- Enable file appenders with rotation
- Set size limits to prevent disk exhaustion
- Use async appenders for better performance
- Suppress verbose libraries (Jetty, Netty, etc.)
- Monitor log file sizes and rotation
Development Logging
- Use DEBUG or TRACE for detailed information
- Console appender for immediate feedback
- Enable HiveMQ component logging as needed
- Disable scanning for better performance in dev
Security Considerations
Diagnostic Mode
HiveMQ can be started in diagnostic mode with enhanced logging. See Diagnostics for details.See Also
- Monitoring - JMX and metrics monitoring
- Diagnostics - Diagnostic mode and troubleshooting
- Logback Documentation - Official Logback manual