how to define logback variables/properties before logback auto-load logback.xml?
问题 My company has an environment management tool that enables you to look up properties from the environment programmatically in Java. I want to leverage this tool to configure logback. For example, suppose I have a logback.xml as follows (the file appender section in particular): <?xml version="1.0" encoding="UTF-8"?> <configuration> <!-- console appender --> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{yyyy-MM-dd/HH:mm:ss.SSS} [%thread] %-5level