What I would like to do is have access to the container logs from the host. For example, if my app has problem, a user could easily see the problem without running docker exec commands.
Since journald is already picking up the logs inside the container, it seems that I should be able to use the journald driver to achieve this.
I’m running an image that uses Photon 1.0 GA OS.
The app is Lightwave which runs under systemd init.
Here’s the commands I’m using:
docker run -d --name lw-sts-0 --privileged --net=host --log-driver=journald -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/lib/vmware/config:/var/lib/vmware/config --volumes-from lw_data_container vmware/lightwave-sts
586958e8e21e7e785b46b85a6879fd18aac20ee6552cc053eae737c75e992541
Attempt to get logs:
docker logs lw-sts-0
Error response from daemon: configured logging reader does not support reading
verify that logs are being captured in the container:
docker exec lw-sts-0 journalctl | grep lightwave
Nov 02 20:37:54 photon-ga.eng.vmware.com configure-lightwave-server[76]: partner
Nov 02 20:37:54 photon-ga.eng.vmware.com configure-lightwave-server[76]: vsphere.local
Nov 02 20:37:54 photon-ga.eng.vmware.com configure-lightwave-server[76]: Administrator
…