I played with the log drivers (I’m on a very old Podman … 1.6.2). What a found was journald didn’t use the file path at all. I used a less specific retrieval (along the lines of just journalctl). It wasn’t satisfactory to me. Instead, I chose the k8s driver. Despite the implications that this is somehow JSON-formatted output, it wasn’t. It wrote my output to the file I requested as plain text. -- Jim Melton
On Jan 25, 2022, at 4:55 PM, Ranbir <m3freak@thesandhufamily.ca> wrote:
Hello Everyone,
I'm testing out using journald for logging from one of my containers. I think I configured it correctly, but I don't see anything in the path I passed to it.
Here's the create command I used:
CreateCommand": [ "podman", "run", "-d", "--name", "postgrey", "--pod", "mailman", "--volume", "postgrey:/var/spool/postfix/postgrey:Z", "--log-driver", "journald", "--log-opt", "path=/var/log/containers/postgrey.log", "postgrey" ],
/var/log/containers is empty:
# ls -l /var/log/containers/ total 0
Docker's docs on retrieving the logs with journalctl don't show me anything:
journalctl CONTAINER_NAME=postgrey -- Logs begin at Wed 2022-01-19 17:04:20 EST, end at Tue 2022-01-25 18:40:27 EST. -- -- No entries --
Incidentally, I used podman to crate the systemd unit files for the pod and dumped them into /etc/systemd/system. I'm starting, stopping, etc the pod using systemctl.
Using journald for logging means the container's logs get written to the host's journal, right? If that's true, what am I doing wrong?
-- Ranbir _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io