From 1144156613ec6661b22d13e357fd308a9ae7c01c Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 25 Jul 2026 00:45:18 -0600 Subject: [PATCH] feat(func): Write to journald Function to write log entries to journald. Update writeLog steering function to use this new backend. --- cfddns.sh | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/cfddns.sh b/cfddns.sh index 9bb27e4..482b1ca 100644 --- a/cfddns.sh +++ b/cfddns.sh @@ -136,6 +136,33 @@ translateLogLevelsToJournalD() { esac } +# $1: message, $2: level, $3: status, [$4: operation], [$5: code] +writeJournalDLog() { + # not enough information to generate a meaningful log message + if [ -z "$1" ] || [ $# -lt 3 ]; then + return + fi + + J_TIMESTAMP="$(getTimeStamp)" + J_PID="$$" + J_PRIO="$(translateLogLevelsToJournalD "$2")" + J_STAT="$(uppercase "$3")" + + logger --journald <