From 3139b41433bbd307693faf40f902311f88d279f1 Mon Sep 17 00:00:00 2001 From: c6ristian Date: Tue, 21 Jan 2025 00:25:13 +0100 Subject: [PATCH] use the container name as journal tag not id Docker by default will use the container id as the journal tag when logging into systemd-journal. Using the container name makes easier to see which log belongs to which container. --- roles/docker/files/daemon.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/docker/files/daemon.json b/roles/docker/files/daemon.json index b58ac35..49d4108 100644 --- a/roles/docker/files/daemon.json +++ b/roles/docker/files/daemon.json @@ -1,3 +1,6 @@ { - "log-driver": "journald" + "log-driver": "journald", + "log-opts": { + "tag": "{{.Name}}" + } }