Note that I was addicted to launching a spring-boot
application from Eclipse.
Explicitly specified with LOGGING_CONFIG
.
logback-spring.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE logback>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<appender name="CONSOLE" class="ch.qos.logback.core.ConsleAppender">
<!--abridgement-->
</appender>
<!--abridgement-->
<springProfile name="debug">
<root level="DEBUG">
<appender-ref ref="CONSOLE" />
</root>
</springProfile>
<!--abridgement-->
</configuration>
If you start it from the command line with java -jar ... --spring.profiles.active = debug
, you will get a DEBUG
level log on the console.
On the other hand, when launched from Eclipse as a Java application
, there was no DEBUG
level log output to the console.
As a result of various trials, the log is output by setting the environment variable as follows in the environment
of the execution configuration
.
variable | value | Remarks |
---|---|---|
LOGGING_CONFIG | src/main/resources/logback-spring.xml | Relative path from the project root |
SPRING_PROFILES_ACTIVE | debug | You may specify it by a method other than the environment variable. |
Recommended Posts