...
Code Block | ||
---|---|---|
| ||
<appender name="MQTT-MESSAGE-LOG-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${hivemq.log.folder}/mqtt-message.log</file> <append>true</append> <encoder> <pattern>%-30(%d %level)- %msg%n%ex</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <fileNamePattern>${hivemq.log.folder}/mqtt-message.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> <minIndex>1</minIndex> <maxIndex>5</maxIndex> </rollingPolicy> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <maxFileSize>100MB</maxFileSize> <checkIncrement>10000</checkIncrement> </triggeringPolicy> </appender> |
The following example logger configuration adds the required logger.
Example MQTT Message Log extension logger configuration
Code Block | ||
---|---|---|
| ||
<logger name="com.hivemq.extensions.log.mqtt" level="DEBUG" additivity="false"> <appender-ref ref="MQTT-MESSAGE-LOG-FILE"/> </logger> |
Info |
---|
In the logger configuration, the |
Extension Log File Verification
To verify creation of the extension log file, go to the log
folder of your HiveMQ installation. Based on the scanPeriod
that is set in the logback.xml
file in your conf
folder, HiveMQ scans the changes and updates your configuration. If you have disabled automatic scanning (scan=false
), you must restart HiveMQ to apply the changes.
...