Module io.jstach.rainbowgum.scopedkeyvalues.provider
module io.jstach.rainbowgum.scopedkeyvalues.provider
EXPERIMENTAL The RainbowGum-backed
io.jstach.rainbowgum.scopedkeyvalues.spi.ScopedKeyValuesProvider for
io.jstach.rainbowgum.scopedkeyvalues.ScopedKeyValues - request/task-scoped key
values backed by java.lang.ScopedValue instead of ThreadLocal. Simply
being on the classpath is enough: this module's
ScopedKeyValuesConfigurator
registers a LogEventFactory.KeyValuesContributor, so every event from any
logging API (SLF4J, JUL, System.Logger, ...) carries the current scoped key values.
SLF4J's MDC wins over scoped key values on a key collision.
Requires a JVM supporting java.lang.ScopedValue (finalized in JDK 25,
JEP 506) - newer than this project's usual
baseline, which is why this module alone overrides its own build's Java release. The
io.jstach.rainbowgum.scopedkeyvalues API module this implements does not share
that requirement.
-
Packages
ExportsPackageDescriptionThe RainbowGum-backedScopedKeyValuesProvider, usingjava.lang.ScopedValuefor storage, plus theRainbowGumServiceProviderthat registers it as a key values contributor for every logging API. -
Services
ProvidesTypeDescriptionRainbowGum SPI.Service Provider InterfaceServiceLoaderactually discovers forScopedKeyValues- a factory rather than theScopedKeyValuesProvideritself, since a factory method can do things a bare no-arg-constructorServiceLoaderinstantiation cannot (validate preconditions, choose between alternate implementations, read configuration, etc) withoutScopedKeyValuesneeding to know anything about how the provider it gets back was actually put together.