Skip to content

Commit 0df1c86

Browse files
ritonstruanb
authored andcommitted
feat: Adapt log format if journald is detected
* Journald has already informations such as hostname or datetime
1 parent 54bde9c commit 0df1c86

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docker-ingress-routing-daemon

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ VERSION=4.1.1
2828
# Workaround for https://github.com/moby/moby/issues/25526
2929

3030
log() {
31+
if [ -n "${JOURNAL_STREAM}" ]
32+
then
33+
# Launched with systemd and journald
34+
echo "$@"
35+
return
36+
fi
37+
3138
[ -z "$_BASHPID" ] && _BASHPID="$BASHPID"
3239
local D=$(date +%Y-%m-%d.%H:%M:%S.%N)
3340
local S=$(printf "%s|%s|%05d|" "${D:0:26}" "$HOSTNAME" "$_BASHPID")

0 commit comments

Comments
 (0)