From 795ac0cc7d9f4f5a25c8c02da7784665aa981b8d Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 23 Aug 2022 19:41:02 +0200 Subject: [PATCH] Clixon-netconf: Redirect logs to syslog by default, instead of stderr --- apps/netconf/netconf_main.c | 4 ++-- lib/src/clixon_netconf_lib.c | 2 +- test/test_netconf_hello.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/netconf/netconf_main.c b/apps/netconf/netconf_main.c index afd34278..35fbb598 100644 --- a/apps/netconf/netconf_main.c +++ b/apps/netconf/netconf_main.c @@ -731,7 +731,7 @@ usage(clicon_handle h, "\t-D \tDebug level\n" "\t-f \tConfiguration file (mandatory)\n" "\t-E \tExtra configuration file directory\n" - "\t-l > \tLog on (s)yslog, std(e)rr, std(o)ut, (n)one or (f)ile (stderr is default)\n" + "\t-l > \tLog on (s)yslog, std(e)rr, std(o)ut, (n)one or (f)ile (syslog is default)\n" "\t-q\t\tServer does not send hello message on startup\n" "\t-0 \t\tSet netconf base capability to 0, server does not expect hello, force EOM framing\n" "\t-1 \t\tSet netconf base capability to 1, server does not expect hello, force chunked framing\n" @@ -760,7 +760,7 @@ main(int argc, int quiet = 0; clicon_handle h; char *dir; - int logdst = CLICON_LOG_STDERR; + int logdst = CLICON_LOG_SYSLOG; struct passwd *pw; struct timeval tv = {0,}; /* timeout */ yang_stmt *yspec = NULL; diff --git a/lib/src/clixon_netconf_lib.c b/lib/src/clixon_netconf_lib.c index 2a7eb9ce..8eae6d3a 100644 --- a/lib/src/clixon_netconf_lib.c +++ b/lib/src/clixon_netconf_lib.c @@ -2088,7 +2088,7 @@ netconf_input_chunked_framing(char ch, { int retval = 0; - clicon_debug(1, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size); + clicon_debug(2, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size); switch (*state){ case 0: if (ch == '\n'){ diff --git a/test/test_netconf_hello.sh b/test/test_netconf_hello.sh index 84bf4e56..0f91edb8 100755 --- a/test/test_netconf_hello.sh +++ b/test/test_netconf_hello.sh @@ -85,7 +85,7 @@ new "Netconf capability: 1.1 + 1.0 -> Error" expecteof "$clixon_netconf -ef $cfg -o CLICON_NETCONF_BASE_CAPABILITY=0" 255 "urn:ietf:params:netconf:base:1.1]]>]]>" 'urn:ietf:params:netconf:base:1.0' new "Netconf snd hello with wrong base capability" -expecteof "$clixon_netconf -qef $cfg" 255 "urn:ietf:params:netconf:base:1.2]]>]]>" '^$' 'Server received hello without matching netconf base capability' +expecteof "$clixon_netconf -qef $cfg -l e" 255 "urn:ietf:params:netconf:base:1.2]]>]]>" '^$' 'Server received hello without matching netconf base capability' new "Netconf hello with MUST NOT have a session-id, terminate" expecteof "$clixon_netconf -qef $cfg" 255 "42urn:ietf:params:netconf:base:1.2]]>]]>" '^$'