Make logging configuration final and immutable; fix native-image logging (#42).
Logging is now driven solely by a single authoritative log4j2.xml that is compiled into
the GraalVM native executable. The previous programmatic setup (LoggingInit calling
LoggerContext.stop() and hand-building appenders) has been removed — it double-configured
under the JVM and did not work in the native binary: log4j-core 2.24.0 shipped no GraalVM
metadata, so neither log4j2.xml nor the plugin registry were bundled, leaving logging
unreliable in the shipped 1.4.11 binary.
Changes:
- Upgrade log4j-api/core 2.24.0 -> 2.25.1, whose GraalVM reachability metadata bundles the
log4j2.*config and the plugin registry into the native image and registers plugin reflection. - Remove the programmatic
LoggingInit;log4j2.xml(console, root INFO,%msg%n) is the
single source of truth. - Add
BundledLog4jConfigurationFactory, installed at startup, which pins the bundled config
and ignores thelog4j2.configurationFilesystem property, theLOG4J_CONFIGURATION_FILE
environment variable, and any externallog4j2.xml.
Verified on GraalVM native builds across Linux, macOS (intel/arm) and Windows: INFO logging
works via the compiled-in configuration and cannot be redirected at runtime.
Full Changelog: 1.4.11...1.4.12