'Does logback fileNamePattern could receive custom parameter from App

There is a spring boot project with logback, and the request url like below

/{customerName}/foo
/{customerName}/bar
...

Want to one log file per customer

<appender name="logFile"  class="ch.qos.logback.core.rolling.RollingFileAppender">
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
        <FileNamePattern>
            /tmp/log/appName/%d{yyyy-MM-dd}-%{customerName}.log
        </FileNamePattern>
        <maxHistory>10</maxHistory>
    </rollingPolicy>
    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>
            %d{[yyyy/MM/dd HH:mm:ss]} - %msg%n
        </Pattern>
    </layout>
</appender>

Does logback support it and how to pass customerName ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source