logback-access-spring-boot-starter
logback-access-spring-boot-starter copied to clipboard
bug: `springProperty` no longer works in 4.2.2
Describe the bug
Including a config file which uses springProperty
does no longer work in version 4.2.2
. It could be the same issue as https://github.com/spring-projects/spring-boot/issues/40491.
logback-access-spring.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="logback-access-base.xml"/>
</configuration>
logback-access-base.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<included>
<!-- is set to true in application.yml -->
<springProperty scope="context" name="consoleEnabled" source="accesslog.console.enabled"/>
<!-- this should evaluate to true and thus add the ConsoleAppender -->
<if condition='${consoleEnabled}'>
<then>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>common</pattern>
</encoder>
</appender>
<appender-ref ref="console"/>
</then>
</if>
</included>
To Reproduce
- Checkout https://github.com/DarkAtra/logback-access-spring-boot-starter-issue
- Start the spring application
- Make a request to
http://localhost:8080
- Observe that nothing is logged
Expected behavior
As accesslog.console.enabled
is set to true
in application.yml
, there should be access logs in the console (see logback-access-base.xml
for details).
Possible Fix
- https://github.com/akkinoc/logback-access-spring-boot-starter/pull/466