From 239d64f6da09d633d37330359b5e7e6b6badf6d8 Mon Sep 17 00:00:00 2001 From: Lianbo Jiang Date: Thu, 12 Nov 2020 23:55:39 +0800 Subject: [PATCH] Appropriately converts logger numeric level to syslog log level The kdump-logger will be used by the system service(daemons), so let's appropriately convert the logger numeric level to syslog level with the facility(daemon). The number is constructed by multiplying the facility by 8 and then adding the level. About The Syslog Protocol, please refer to the RFC5424 for more details. Signed-off-by: Lianbo Jiang Acked-by: Kairui Song --- kdump-logger.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kdump-logger.sh b/kdump-logger.sh index cf4d810..c81e614 100755 --- a/kdump-logger.sh +++ b/kdump-logger.sh @@ -172,7 +172,10 @@ _dlvl2syslvl() { *) return 1;; esac - [ -s /proc/vmcore ] && echo $((24+$lvl)) || echo $((8+$lvl)) + # The number is constructed by multiplying the facility by 8 and then + # adding the level. + # About The Syslog Protocol, please refer to the RFC5424 for more details. + echo $((24+$lvl)) } ## @brief Prints to stderr, to syslog and/or /dev/kmsg given message with