]> git.ipfire.org Git - people/ms/strongswan.git/commit
sys-logger: Optionally support mapping strongSwan loglevels to syslog levels
authorMartin Willi <martin@strongswan.org>
Thu, 20 Jan 2022 13:48:48 +0000 (14:48 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 24 Jan 2022 16:33:02 +0000 (17:33 +0100)
commit9877ce6c5633bbe82507c4629fdf19ecd931d7d0
tree088831862f89591bbd8832c3bd247f9934ac401d
parente3d1766aff96324a48612fa64e6fb36475c71afc
sys-logger: Optionally support mapping strongSwan loglevels to syslog levels

strongSwan logs all syslog messages using LOG_INFO for historical reasons,
regardless of the strongSwan loglevel used producing the log message.

In some setups with advanced logging infrastructure, it may be feasible
to be more verbose when logging in strongSwan, but then filter messages
on the syslog server. While this may be possible by custom syslog filtering
rules matching the log level included with the log_level setting, this is
not super convenient.

So add a new map_level setting, which can map strongSwan loglevels to
syslog loglevels. By default this is disabled, keeping the existing
behavior. If enabled, it maps strongSwan loglevels to syslog loglevels
at a given syslog loglevel offset.

Closes strongswan/strongswan#859
conf/options/charon-logging.opt
src/libcharon/bus/listeners/sys_logger.c
src/libcharon/bus/listeners/sys_logger.h
src/libcharon/daemon.c