[Java] logback-spring.xml

Note that I was addicted to launching a spring-boot application from Eclipse.

Conclusion

Explicitly specified with LOGGING_CONFIG.

Background

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

[Java] logback-spring.xml
Java
Java learning (0)
Studying Java ―― 3
[Java] array
Java protected
[Java] Annotation
Java array
Studying Java ―― 9
Java scratch scratch
java (constructor)
[Java] ArrayDeque
java (override)
java (method)
Java Day 2018
Java string
java (array)
Java static
java beginner 4
Studying Java ―― 4
Java (set)
java shellsort
[Java] compareTo
Studying Java -5
java reflexes
Java memorandum
☾ Java / Collection
Java array
Studying Java ―― 1
[Java] Array
[Java] Polymorphism
Studying Java # 0
Java review
java framework
[Java] Inheritance
FastScanner Java
java beginner 3
java (encapsulation)
Java inheritance
[Java] Overload
Java basics
Decompile Java
[Java] Annotation
java notes
java beginner
Java (add2)
JAVA (Map)
[java] interface
Java9 collection
Java basics
Java methods
Java inheritance
[Java] enum
[Java] FizzBuzzCounter
Studying Java ―― 8
Java array
Java method
java serializable
JAVA memorandum
Java libraries
JAVA decompile (decompile)