Spring boot logs use logback for output by default. You can customize logback as follows:
Create a logback.xml configuration file in the resources folder
<?xml version="1.0" encoding="UTF-8"?><configuration><!-- base.xml in the spring-boot jar, --><include resource="org/springframework/boot/logging/logback/base.xml"/><!--<logger name="org.springframework.web" level="DEBUG"/>--><!-- 输出hibernate的sql,会同时记录在文件日志中去,所以使用:spring.jpa.show-sql 配置比较好 --><!--<logger name="org.hibernate.SQL" level="DEBUG" />--><logger name="org.springframework.jdbc.core.JdbcTemplate" level="DEBUG"/><logger name="org.apache.tomcat.jdbc.pool" level="DEBUG"/></configuration>
For specific configuration, you can locate it in spring-boot.jar to see it
The log file path configuration can be configured in application.properties
logging.file=/tmp/logs/springboottest.log
The above is the detailed content of Java spring boot 1.5.4 log management. For more information, please follow other related articles on the PHP Chinese website!