I'm using Spring Boot 1.3.0.RC1 through spring-cloud Brixton.M2 and have been unable to pull spring boot properties into logback.xml as implied by this feature checkin Support springProperty in logback configurations
I'm using .yml files and want to pull application name out of bootstrap.yml or application.yml.
logback-spring.xml:
<configuration>
<springProperty scope="context" name="myappName" source="spring.application.name"/>
<contextName>${myappName}</contextName>
<appender name="logFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/${myappName}.log</file>
...
</appender>
...
</configuration>
The documentation here Spring Boot Logback extensions doesn't help much.
This other stackoverflow question Unable to use Spring Property Placeholders in logback.xml is older and doesnt work for me either. Any insight would be helpful.
Per request, here is the relevant dependency tree that is being used
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.3.0.RC1:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.3.0.RC1:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.3.0.RC1:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.3.0.RC1:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.3.0.RC1:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.16:runtime
Per 2nd request for info, what is actually going on is that logback property myappName does not get a value. The way I know this is that the value becomes "myappName_IS_UNDEFINED" and my logfile gets named "myappName_IS_UNDEFINED.log" and the %contextName is set to "myappName_IS_UNDEFINED".