So, as the title suggests, I have a containerized service running in docker, and I have a systemd service unit to manage said service automatically. Alongside that, I would like to have the logs for the docker container sent to the service logs. Is there any way I could have the logs provided in the docker logs SERVICE
command piped to the output of the systemd service logs?
My first attempt at this was to set an ExecStartPost
call to docker logs -f SERVICE
, however that did not seem to work as restarting the service provided an error. I did also find this link about logging to journald, and I get the feeling this may be on the right track, but I see no explicit way provided to pipe that specifically to the systemd service in question.