Debugging Spring configuration

前端 未结 2 636
余生分开走
余生分开走 2020-12-04 08:27

I am working on a Java application that uses Spring and Hibernate and runs on a Websphere. I have run into a problem, where I expect Spring to load a Dao into my object, bu

2条回答
  •  星月不相逢
    2020-12-04 09:13

    If you use Spring Boot, you can also enable a “debug” mode by starting your application with a --debug flag.

    java -jar myapp.jar --debug
    

    You can also specify debug=true in your application.properties.

    When the debug mode is enabled, a selection of core loggers (embedded container, Hibernate, and Spring Boot) are configured to output more information. Enabling the debug mode does not configure your application to log all messages with DEBUG level.

    Alternatively, you can enable a “trace” mode by starting your application with a --trace flag (or trace=true in your application.properties). Doing so enables trace logging for a selection of core loggers (embedded container, Hibernate schema generation, and the whole Spring portfolio).

    https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html

提交回复
热议问题