title: Tomcat, Docker, Logging, and STDOUT?
body: <p>I'm running tomcat in docker, but I can't see the logs. They are written to various log files under tomcat/logs, but I can't see them when tomcat is running in a docker container.</p>
  
  <p>Here is my Dockerfile</p>
  
  <pre><code>FROM tomcat:7-jre8
  COPY target/MYAPP.war /usr/local/tomcat/webapps/MYAPP.war
  RUN ["/usr/local/tomcat/bin/catalina.sh", "start"]
  </code></pre>
  
  <p>This is how I build image &amp; start container from it:</p>
  
  <pre><code>docker build -t MYAPP .
  docker run -it --rm -p 8080:8080 --name MYAPP MYAPP
  </code></pre>
  
  <p>My app creates log file: /var/log/MYAPP.log after tomcat deploys MYAPP.war</p>
  
  <p>How should I amend Dockerfile and which command should I use to run it ("docker run ...") so that right after starting the container MYAPP using the oneliner "docker run -it --rm -p 8080:8080 --name MYAPP MYAPP" the contents of /var/log/MYAPP.log would be printed to stdout?</p>
  
  <p>I tried to add to Dockerfile the command below but it didn't help.</p>
  
  <pre><code>CMD tail -f /usr/local/MYAPP.log
  </code></pre>