简体   繁体   中英

Where is the crash log of spring boot embedded Tomcat?

I am using Spring boot 1.3.1 with its embedded Tomcat container. I am new to Spring boot.

I run with as a standalone jar via java -jar myApp.jar .

I set the log file and tomcat location in the application.properties :

logging.file=myApp.log
server.tomcat.basedir=./tomcat

However, the app exits quite often QUIETLY. In the log file nothing informative of the exit.

So my question is how to enable some more detailed logging of the application, or is there some method can be used to trouble shooting in this situation?

Thanks!

You can enable logging via application.properties using properties starting with logging.level . To enable debug logging for everything :

logging.level.ROOT=DEBUG

Alternatively, you can enable logging for a particular package (and its sub packages). For example:

logging.level.org.apache.tomcat=DEBUG

You can deploy the same package to standalone Tomcat to get the root cause of the failure. Exceptions at certain stages of the application startup will stay hidden otherwise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM