Home > Java > javaTutorial > body text

Java spring boot 1.5.4 log management

怪我咯
Release: 2017-06-26 11:41:58
Original
1654 people have browsed it

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>
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!