1# Copyright (c) 2024 Arif Balik <arifbalik@outlook.com>
2# SPDX-License-Identifier: Apache-2.0
3
4config LOG_BACKEND_MQTT
5	bool "MQTT backend"
6	depends on MQTT_LIB && !LOG_MODE_IMMEDIATE
7	help
8	  Send log messages to an MQTT broker using an external MQTT client.
9	  This backend publishes log messages to a configurable MQTT topic
10	  using an MQTT client provided by the application via the
11	  log_backend_mqtt_client_set() API. The application is responsible
12	  for initializing, connecting, and managing the MQTT client lifecycle.
13
14if LOG_BACKEND_MQTT
15
16config LOG_BACKEND_MQTT_TOPIC_DEFAULT
17	string "Default MQTT topic for log messages"
18	default "zephyr/logs"
19	help
20	  Default MQTT topic for log messages. Use log backend MQTT API to change it at runtime.
21
22config LOG_BACKEND_MQTT_QOS
23	int "MQTT Quality of Service level"
24	default 0
25	range 0 2
26	help
27	  QoS level for published log messages:
28	  0 - At most once delivery (fire and forget)
29	  1 - At least once delivery (acknowledged delivery)
30	  2 - Exactly once delivery (assured delivery)
31
32config LOG_BACKEND_MQTT_RETAIN
33	bool "Retain MQTT messages"
34	help
35	  When enabled, published log messages will be retained by the broker
36	  and delivered to new subscribers immediately upon subscription.
37
38config LOG_BACKEND_MQTT_MAX_MSG_SIZE
39	int "Maximum log message size"
40	default 256
41	range 64 1024
42	help
43	  Maximum size of a single log message in bytes.
44
45backend = MQTT
46backend-str = mqtt
47source "subsys/logging/Kconfig.template.log_format_config"
48
49endif # LOG_BACKEND_MQTT
50