Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: syslog: Make sure CONFIG_LOG_IMMEDIATE is not set #30290

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions samples/net/syslog_net/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5
CONFIG_NET_LOG=y
CONFIG_LOG=y

# Immediate logging does not work with network syslog as it would cause
# the sent packet to be malformed (contains only 1 byte data)
CONFIG_LOG_IMMEDIATE=n
CONFIG_LOG_PROCESS_THREAD=y

CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=n
Expand Down
2 changes: 2 additions & 0 deletions samples/net/syslog_net/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ LOG_MODULE_REGISTER(net_syslog, LOG_LEVEL_DBG);
#include <net/net_core.h>
#include <net/net_pkt.h>

BUILD_ASSERT(IS_ENABLED(CONFIG_LOG_BACKEND_NET), "syslog backend not enabled");

#define SLEEP_BETWEEN_PRINTS 3

void main(void)
Expand Down
4 changes: 3 additions & 1 deletion subsys/logging/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,11 @@ config LOG_BACKEND_XTENSA_OUTPUT_BUFFER_SIZE
Buffer is used by log_output module for preparing output data (e.g.
string formatting).

# Immediate mode cannot be used with network backend as it would cause the sent
# rsyslog message to be malformed.
config LOG_BACKEND_NET
bool "Enable networking backend"
depends on NETWORKING
depends on NETWORKING && NET_UDP && !LOG_IMMEDIATE
select NET_CONTEXT_NET_PKT_POOL
help
Send syslog messages to network server.
Expand Down