|
65 | 65 | import org.springframework.boot.logging.LoggingInitializationContext; |
66 | 66 | import org.springframework.boot.logging.LoggingSystem; |
67 | 67 | import org.springframework.boot.logging.LoggingSystemFactory; |
| 68 | +import org.springframework.boot.logging.LoggingSystemProperties; |
68 | 69 | import org.springframework.core.Conventions; |
69 | 70 | import org.springframework.core.annotation.Order; |
| 71 | +import org.springframework.core.env.ConfigurableEnvironment; |
70 | 72 | import org.springframework.core.env.Environment; |
71 | 73 | import org.springframework.core.io.Resource; |
72 | 74 | import org.springframework.core.io.ResourceLoader; |
@@ -155,6 +157,11 @@ public Log4J2LoggingSystem(ClassLoader classLoader) { |
155 | 157 | super(classLoader); |
156 | 158 | } |
157 | 159 |
|
| 160 | + @Override |
| 161 | + public LoggingSystemProperties getSystemProperties(ConfigurableEnvironment environment) { |
| 162 | + return new Log4j2LoggingSystemProperties(environment, getDefaultValueResolver(environment), null); |
| 163 | + } |
| 164 | + |
158 | 165 | @Override |
159 | 166 | protected String[] getStandardConfigLocations() { |
160 | 167 | List<String> locations = new ArrayList<>(); |
@@ -324,15 +331,10 @@ private void load(LoggingInitializationContext initializationContext, String loc |
324 | 331 | List<String> overrides = getOverrides(initializationContext); |
325 | 332 | Environment environment = initializationContext.getEnvironment(); |
326 | 333 | Assert.state(environment != null, "'environment' must not be null"); |
327 | | - applyLog4j2SystemProperties(environment, logFile); |
| 334 | + applySystemProperties(environment, logFile); |
328 | 335 | loadConfiguration(location, logFile, overrides); |
329 | 336 | } |
330 | 337 |
|
331 | | - |
332 | | - private void applyLog4j2SystemProperties(Environment environment, @Nullable LogFile logFile) { |
333 | | - new Log4j2LoggingSystemProperties(environment, getDefaultValueResolver(environment), null).apply(logFile); |
334 | | - } |
335 | | - |
336 | 338 | private List<String> getOverrides(LoggingInitializationContext initializationContext) { |
337 | 339 | Environment environment = initializationContext.getEnvironment(); |
338 | 340 | Assert.state(environment != null, "'environment' must not be null"); |
|
0 commit comments