Since Log4j 2.14.0, configuration files can resolve properties from Spring's Environment.

While this is already possible with the custom Log4j2CloudConfigLoggingSystem, this PR enables this feature in the standard Log4j2LoggingSystem.

Comment From: wilkinsona

Thanks for the proposal. Unfortunately, we’re not keen on the existing circular dependencies between Spring Boot and Log4j 2 and this will strengthen that cycle. We feel that is the wrong direction to take.

We’d prefer to break the cycle as proposed in #28909 by providing functionality that is equivalent to SpringLookup. This would also remove one of the differences between Spring Boot’s Logback and Log4j 2 integration.

Thanks again for the proposal.