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.
Here is my Dockerfile
FROM tomcat:7-jre8
COPY target/MYAPP.war /usr/local/tomcat/webapps/MYAPP.war
RUN ["/usr/local/tomcat/bin/catalina.sh", "start"]
This is how I build image & start container from it:
docker build -t MYAPP .
docker run -it --rm -p 8080:8080 --name MYAPP MYAPP
My app creates log file: /var/log/MYAPP.log after tomcat deploys MYAPP.war
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?
I tried to add to Dockerfile the command below but it didn't help.
CMD tail -f /usr/local/MYAPP.log