1
votes

I want to be able run docker container and see all instance journalctl logs. In other words I want to see the same output of journalctl logs in Instance and in Docker container.

I was trying to mount the journald socket but still I don't see the journal logs from the instance

Thanks for the help.

1
Did you ever find a solution to this? - skaldesh

1 Answers

2
votes

If journalctl -u <service>.service and not giving you the journal logs you want from your container, you can run machinectl -l to find the container's UUID and then run a journalctl -M $UUID on the container uuid to see logs.

~# machinectl -l
MACHINE                                  CLASS     SERVICE OS VERSION ADDRESSES
rkt-6d427a1c-6961-45a2-a055-721edddb8558 container rkt     -  -       -



~# journalctl -M rkt-6d427a1c-6961-45a2-a055-721edddb8558

If your systemd service starting your docker container is not listed under machinectl list, then add the following to your systemd service file that is starting your container:

[Service]
Slice=machine.slice

Cheers!