Docker container can only to daemon mode: I run catalina.sh
to start the tomcat.
But the problem is my log will not appear in catalina.out
.
I can look at `docker logs , but this certainly cannot run in a production environment.
I would like to ask how, in production environment, can I have the Tomcat log stored in the document and without the container stopping?
If you look at the official tomcat docker image, it runs
CMD ["catalina.sh", "run"]
That is enough to starts tomcat in the foreground, displaying the logs on the console.
But, as you said, that might not populate catalina.out.
CMD service tomcat start && tail -f /var/lib/tomcat/logs/catalina.out