apache / logging-log4j-kotlin

A Kotlin-friendly interface to log against the Log4j API
https://logging.apache.org/log4j/kotlin
Apache License 2.0
46 stars 12 forks source link

Add caching for logger lookups via interface mixin #19

Closed rocketraman closed 3 years ago

rocketraman commented 3 years ago

I realized the mixin was super-slow because the property delegate creates a new logger every time it is used. See https://issues.apache.org/jira/browse/LOG4J2-3086.

The only workaround I could find was to use caching. However, I'm not super happy with the implementation here -- I don't like creating an unbounded cache like this. However, I don't see any easy workarounds. @jvz suggestions welcome.