Index

Table of contents

default logback configuration

src/main/resources/logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml" />

    <root level="INFO">
        <appender-ref ref="CONSOLE" />
        <appender-ref ref="FILE" />
    </root>

    <logger name="org.springframework" level="INFO"/>
</configuration>

separate log configuration file for development:

src/main/resources/logback-dev.xml
<root level="INFO">
        <appender-ref ref="CONSOLE" />
        <appender-ref ref="FILE" />
    </root>
    <logger name="com.example" level="TRACE" />
src/main/resources/application-dev.properties
logging.config=classpath:logback-dev.xml
starting the spring boot application with the dev profile active
java -jar target/*.jar --spring.profiles.active=dev