diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java b/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java index 958ddce771..dab8d1159b 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java @@ -112,7 +112,7 @@ class DefaultLogbackConfiguration { String logFile) { RollingFileAppender appender = new RollingFileAppender(); PatternLayoutEncoder encoder = new PatternLayoutEncoder(); - encoder.setPattern(FILE_LOG_PATTERN); + encoder.setPattern(OptionHelper.substVars(FILE_LOG_PATTERN, config.getContext())); appender.setEncoder(encoder); config.start(encoder);