|
51 | 51 | import org.apache.logging.log4j.status.StatusConsoleListener; |
52 | 52 | import org.apache.logging.log4j.status.StatusLogger; |
53 | 53 | import org.apache.logging.log4j.util.PropertiesUtil; |
54 | | -import org.apache.logging.log4j.core.config.plugins.util.PluginRegistry; |
55 | 54 | import org.jspecify.annotations.Nullable; |
56 | 55 |
|
57 | 56 | import org.springframework.boot.context.properties.bind.BindResult; |
@@ -326,24 +325,9 @@ private void load(LoggingInitializationContext initializationContext, String loc |
326 | 325 | Environment environment = initializationContext.getEnvironment(); |
327 | 326 | Assert.state(environment != null, "'environment' must not be null"); |
328 | 327 | applyLog4j2SystemProperties(environment, logFile); |
329 | | - registerSpringBootPlugins(); |
330 | 328 | loadConfiguration(location, logFile, overrides); |
331 | 329 | } |
332 | 330 |
|
333 | | - private void registerSpringBootPlugins() { |
334 | | - String pluginPackages = SpringBootTriggeringPolicy.class.getPackageName(); |
335 | | - String existing = System.getProperty("log4j.plugin.packages"); |
336 | | - if (StringUtils.hasText(existing)) { |
337 | | - if (!existing.contains(pluginPackages)) { |
338 | | - System.setProperty("log4j.plugin.packages", existing + "," + pluginPackages); |
339 | | - PluginRegistry.getInstance().clear(); |
340 | | - } |
341 | | - } |
342 | | - else { |
343 | | - System.setProperty("log4j.plugin.packages", pluginPackages); |
344 | | - PluginRegistry.getInstance().clear(); |
345 | | - } |
346 | | - } |
347 | 331 |
|
348 | 332 | private void applyLog4j2SystemProperties(Environment environment, @Nullable LogFile logFile) { |
349 | 333 | new Log4j2LoggingSystemProperties(environment, getDefaultValueResolver(environment), null).apply(logFile); |
|
0 commit comments