← Back to team overview

mosquitto-users team mailing list archive

Problem in log_type debug with log_dest topic

 

Hi All,

I am trying to capture the 'debug' level logs with log destination type
'topic'.

But all I am getting at the listener point are notification log (with topic
$SYS/broker/log/N).

Here is the use case:

1) Start broker with below configuration:
log_type debug
log_type notice
log_dest topic

2) Start a client to listen and subscribe below topics:

$SYS/broker/log/D
$SYS/broker/log/N
or
$SYS/broker/log/#

3) Start another client, connect to the broker and subscribe/publish some
messages.

Result: Listener receives only notification logs and not the debug logs.
If I change log_dest to stdout then I get the debug level logs at stdout.

Am I doing something wrong with log_dest='topic' or debug is just not
allowed with it?

What I understand from mosquitto code (logging.c) is logs will be published
to topic only when log_type != debug

#192>> if(log_destinations & MQTT3_LOG_TOPIC && priority != MOSQ_LOG_DEBUG)
{
//Process
}

If I am right, that debug level logging is not allowed with dest_type
topic, can anyone tell me what is the significance of this restriction?

Thanks and Regards,
Prashant

Follow ups