Skip to content

Commit df1dede

Browse files
committed
Substitute ${PID} variables with file logging
Update DefaultLogbackConfiguration to include OptionHelper.substVars when setting the encoder pattern so that ${PID} is correctly expanded. Fixes spring-projectsgh-2119
1 parent fc2e616 commit df1dede

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private Appender<ILoggingEvent> fileAppender(LogbackConfigurator config,
112112
String logFile) {
113113
RollingFileAppender<ILoggingEvent> appender = new RollingFileAppender<ILoggingEvent>();
114114
PatternLayoutEncoder encoder = new PatternLayoutEncoder();
115-
encoder.setPattern(FILE_LOG_PATTERN);
115+
encoder.setPattern(OptionHelper.substVars(FILE_LOG_PATTERN, config.getContext()));
116116
appender.setEncoder(encoder);
117117
config.start(encoder);
118118

0 commit comments

Comments
 (0)