How to check container log of tomcat?

会有一股神秘感。 提交于 2019-12-22 01:13:16

问题


How do I check the container log of tomcat?

I get this error from the catalina.out log:

SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file

But where can I find the "appropriate container log" that this log is referring to?

Thanks in advance.


回答1:


You'll find the referenced log file in the same directory containing the log referencing the other log file. With a default installation of Tomcat, the directory is $CATALINA_HOME/logs. The log file containing the information referenced will usually be the one named with the hostname on which Tomcat is running. On a simple server (e.g. development environment) this is localhost.<datestamp>.log. The additional error information can be found in this log file at the same timestamp as the noted reference in the referring log file.




回答2:


I bumped into the same issue while working on a web application.

Tomcat logs did not show full stack trace and application has more than one listeners, it may get challenging to figure out the issue. After some browsing, below is what helped me find the error.

Create a file logging.properties with the following content, place it inside Apache-tomcat\webapps\MyApp\WEB-INF\classes and restart the Apache Tomcat server.

org.apache.catalina.core.ContainerBase.[Catalina].level=INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers=java.util.logging.ConsoleHandler


来源:https://stackoverflow.com/questions/36617732/how-to-check-container-log-of-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!