Replies: 15 comments 5 replies
-
How are you trying to capture the logs? The logs should be visible via |
Beta Was this translation helpful? Give feedback.
-
Yes, I am attempting to use
If I use |
Beta Was this translation helpful? Give feedback.
-
I can see the logs of the container in the journal (see below):
You can also use |
Beta Was this translation helpful? Give feedback.
-
This looks like a systemd inside of the container, which is taking all of the logs and putting them in a separate location. The podman logs command is only going to show you the output of the systemd process not the processes inside of the container which are writing to journald. |
Beta Was this translation helpful? Give feedback.
-
@vrothberg @rhatdan |
Beta Was this translation helpful? Give feedback.
-
That looks like a Debian-specific problem. It should just work.
In that case, it's likely that the systemd inside the container is eating the logs. |
Beta Was this translation helpful? Give feedback.
-
Systemd inside the container is in fact recording the logs internally, however, I do have journald inside the container set to forward to the wall, which, to my understanding should send the logs additionally to the tty provided with |
Beta Was this translation helpful? Give feedback.
-
Podman is going to record stdout and stderr from pid1. I am not sure hat the "wall" is? Does this mean that systemd process running as pid 1 inside of the container will start writing everything in the journal to stdout/stderr? |
Beta Was this translation helpful? Give feedback.
-
I misspoke, Journald is configured to write to the console as per the documentation here. As a test, I attempted to write to both |
Beta Was this translation helpful? Give feedback.
-
If you run with a tty attached to the container in foreground, do you see the content on the tty? |
Beta Was this translation helpful? Give feedback.
-
If I trim the appropriate parts from my unit file command and run the following: /bin/bash -c ' \
/usr/bin/podman run \
-d \
--name test \
--restart no \
--replace \
--rm \
--stop-timeout 60 \
-t \
--systemd=always \
docker.io/notmycloud/papercut-mp:latest \
' I am able to get output from |
Beta Was this translation helpful? Give feedback.
-
Ok so is there a problem? |
Beta Was this translation helpful? Give feedback.
-
It seems to be when utilizing Systemd to run the container that the logs do not get captured anywhere other than the journal instance inside of the container. |
Beta Was this translation helpful? Give feedback.
-
A friendly reminder that this issue had no activity for 30 days. |
Beta Was this translation helpful? Give feedback.
-
This seems to be a systemd thing and not something Podman can easily fix. One other thing you might want to look at is the passthrough log type. |
Beta Was this translation helpful? Give feedback.
-
/kind bug
Description
A continuation off #16923.
On my host, I am running this container as a Systemd service and I am unable to capture log output to Journald.
Here is my unit file.
I have tried without the
--log-driver
flag as well as thejournald
andnone
options.I have also tried with and without the
-t
, but I have found that when running manually in my shell I need that option to get output when Systemd in the container takes over.Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):NOTE: I am using the Alvistack repo to get the latest Podman on Debian.
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Physical Debian GNU/Linux 11 (bullseye)
Beta Was this translation helpful? Give feedback.
All reactions