config: add syslog-facility option to allow routing logs independently

ocserv always logged to the syslog daemon(3) facility, making it
impossible to route its messages separately from other daemons.
Adds a syslog-facility config key (and --syslog-facility CLI flag)
accepting daemon/user/auth/authpriv/local0-local7; defaults to daemon.

Resolves: #691

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
Nikos Mavrogiannopoulos
2026-06-03 19:52:36 +02:00
parent 708f42a455
commit 0f5c628048
10 changed files with 299 additions and 14 deletions
+7
View File
@@ -559,6 +559,13 @@ pid-file = /var/run/ocserv.pid
# [scope: global (non-reloadable)]
log-level = 2
# Syslog facility to use when logging to syslog.
# Allowed values: daemon (default), user, auth, authpriv, local0..local7.
# Choosing a local facility lets you direct ocserv messages to a dedicated
# log file via rsyslog/syslog-ng without affecting other daemon logs.
# [scope: global (non-reloadable)]
#syslog-facility = daemon
# Set the protocol-defined priority (SO_PRIORITY) for packets to
# be sent. That is a number from 0 to 6 with 0 being the lowest
# priority. Alternatively this can be used to set the IP Type-