title: docker container reading another container logs
body: <p>I want to create a docker that reads the logs, stdout and stderr from another container 'factorio' on a continuous basis.</p>
  
  <p>I know i should do this as a volume but my best current option is </p>
  
  <p><code>sudo docker logs -f factorio &amp;&gt; /var/log/factorio/current.logs</code></p>
  
  <p>I run the above in a screen.  I had it as a background command but when you exit the terminal it would exit that command.  Screen allows it to run on its own terminal.</p>
  
  <p>which runs in the background and constantly updates the file.  My newapp 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 dont know how.</p>
  
  <p>someapp docker command below:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The log file is <code>/opt/factorio/factorio-current.log</code> but does not include stdout or stderr.  docker logs contains this information</p>