Home  >  Article  >  Java  >  Java spring boot 1.5.4 log management

Java spring boot 1.5.4 log management

怪我咯
怪我咯Original
2017-06-26 11:41:581639browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn