docker container reading another container logs

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Emily29
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Feb 25, 2020 5:42 am
Contact:

docker container reading another container logs

Post by Emily29 »

I want to create a docker that reads the logs, stdout and stderr from another container 'factorio' on a continuous basis.

I know I should do this as a volume but my best current option is

sudo docker logs -f factorio &> /var/log/factorio/current.logs

I run the above on a screen. I had it as a background command but when you exit the terminal it would exit that command. The screen allows it to run on its own terminal.

which runs in the background and constantly updates the file. My new app container connect as a volume to this file location and tails every 5 seconds to get any updates and send notifications based on those updates. There is definitely a better way to do this with volumes but I don't know-how.

some app docker command below:

sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
dtandersen/factorio:0.17.16
The log file is /opt/factorio/factorio-current.log but does not include stdout or stderr. docker logs contains this information.
Koub
Global Moderator
Global Moderator
Posts: 7955
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: docker container reading another container logs

Post by Koub »

[Koub] Moved to Technical Help
Koub - Please consider English is not my native language.
Post Reply

Return to “Technical Help”