1# Copyright (c) 2021 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4# Immediate mode cannot be used with network backend as it would cause the sent
5# rsyslog message to be malformed.
6config LOG_BACKEND_NET
7	bool "Networking backend"
8	depends on NETWORKING && NET_UDP && !LOG_MODE_IMMEDIATE
9	select NET_CONTEXT_NET_PKT_POOL
10	select LOG_OUTPUT
11	help
12	  Send syslog messages to network server.
13	  See RFC 5424 (syslog protocol) and RFC 5426 (syslog over UDP)
14	  specifications for details.
15
16if LOG_BACKEND_NET
17
18config LOG_BACKEND_NET_SERVER
19	string "Syslog server IP address"
20	help
21	  This can be either IPv4 or IPv6 address.
22	  Server listen UDP port number can be configured here too.
23	  Following syntax is supported:
24	  192.0.2.1:514
25	  192.0.2.42
26	  [2001:db8::1]:514
27	  [2001:db8::2]
28	  2001:db::42
29
30config LOG_BACKEND_NET_MAX_BUF
31	int "How many network buffers to allocate for sending messages"
32	range 3 256
33	default 3
34	help
35	  Each syslog message should fit into a network packet that will be
36	  sent to server. This number tells how many syslog messages can be
37	  in transit to the server.
38
39config LOG_BACKEND_NET_MAX_BUF_SIZE
40	int "Max syslog message size"
41	range 64 1180
42	default 1180 if NET_IPV6
43	default 480 if NET_IPV4
44	default 256
45	help
46	  As each syslog message needs to fit to UDP packet, set this value
47	  so that messages are not truncated.
48	  The RFC 5426 recommends that for IPv4 the size is 480 octets and for
49	  IPv6 the size is 1180 octets. As each buffer will use RAM, the value
50	  should be selected so that typical messages will fit the buffer.
51
52config LOG_BACKEND_NET_AUTOSTART
53	bool "Automatically start networking backend"
54	default y if NET_CONFIG_NEED_IPV4 || NET_CONFIG_NEED_IPV6
55	help
56	  When enabled automatically start the networking backend on
57	  application start. If no routes to the logging server are available
58	  on application startup, this must be set to n and the backend must be
59	  started by the application later on. Otherwise the logging
60	  thread might block.
61
62backend = NET
63backend-str = net
64source "subsys/logging/Kconfig.template.log_format_config"
65
66endif # LOG_BACKEND_NET
67