ppkarwasz opened a new pull request, #2849: URL: https://github.com/apache/logging-log4j2/pull/2849
The `PropertiesUtil` class preemptively caches lookups for all known keys from enumerable property sources. On my Debian system a JVM has around 60 among environment variables and system properties, which causes `PropertiesUtil` to perform around 60 lookups for **each** of the 3 standard property sources. Most of these properties have nothing to do with Log4j. On the other hand all Log4j artifacts use no more than 100 configuration properties and the results of most of those calls are cache in static fields. This PR removes the property value caches used by `PropertiesUtil`. The change should have no noticeable impact on the loading time of Log4j Core, while at the same time simplifies the system. As remarkable side effect **token-based** matching of property names is no longer supported. This mean that, e.g. a system property like [`log4j2.asyncLoggerRingBufferSize`](https://logging.staged.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.asyncLoggerRingBufferSize) can be written: - as `AsyncLogger.RingBufferSize` (pre-2.10 legacy form), - as `log4j2.asyncLoggerRingBufferSize` (2.10 canonical form). No other forms (e.g. `log4j.async.logger.ringBuffer.size`) are accepted. **Note**: We never documented that we support token-based matching. See [current Configuration Properties](https://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties) documentation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
