Class JULConfigurator
java.lang.Object
io.jstach.rainbowgum.jul.JULConfigurator
- All Implemented Interfaces:
RainbowGumServiceProvider, RainbowGumServiceProvider.Configurator, AutoCloseable
@ServiceProvider(RainbowGumServiceProvider.class)
public final class JULConfigurator
extends Object
implements RainbowGumServiceProvider.Configurator, AutoCloseable
Will install the JUL handler if the
java.logging module is available and
is not alreadyi installed.-
Nested Class Summary
Nested classes/interfaces inherited from interface RainbowGumServiceProvider
RainbowGumServiceProvider.Configurator, RainbowGumServiceProvider.Pass, RainbowGumServiceProvider.PropertiesProvider, RainbowGumServiceProvider.RainbowGumEagerLoad, RainbowGumServiceProvider.RainbowGumProviderModifier and TypeInterfaceDescriptionstatic interfaceCalled afterLogConfighas been loaded to do various custom initialization like registeringLogOutput.OutputProviders.static enumProviders sometimes need multiple passes to support dependencies without using true dependency injection.static interfaceProvides properties and or register services.static interfaceThis is a marker interface that indicates that a facade implementation will do the eager loading of RainbowGum.static interfaceImplement to create a custom RainbowGum. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIf true will not install the JUL handler.static final StringSets the level of the java.util.logging root logger. java.util.logging checks it, and any levels configured in java.util.logging itself, before an event reaches Rainbow Gum, so an event below it is not logged even if Rainbow Gum would log it.Fields inherited from interface RainbowGumServiceProvider
PASSESModifier and TypeFieldDescriptionstatic final intThe default amount of passes made to resolve registrators or configurators.Fields inherited from interface RainbowGumServiceProvider.Configurator
CONFIGURATOR_PASSESModifier and TypeFieldDescriptionstatic final intThe default amount of passes made to resolve configurators. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanconfigure(LogConfig config, RainbowGumServiceProvider.Pass pass) Do ad-hoc initialization before RainbowGum is fully loaded.static booleaninstall(LogProperties properties) Will install the JUL handler if not disabled by properties.static booleanWill test if already installed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RainbowGumServiceProvider.Configurator
priority
-
Field Details
-
JUL_DISABLE_PROPERTY
If true will not install the JUL handler.Property:
logging.jul.disable- See Also:
-
JUL_LEVEL_PROPERTY
Sets the level of the java.util.logging root logger. java.util.logging checks it, and any levels configured in java.util.logging itself, before an event reaches Rainbow Gum, so an event below it is not logged even if Rainbow Gum would log it. Values (case is ignored):sync(default): the root level of Rainbow Gum. Events of a logger configured more verbose than the root, such aslogging.level.com.example=debugwith aninforoot, are not logged when they are below the root level.none: the level is left as java.util.logging is configured, for example bylogging.properties.- A level such as
all,debugorinfo: that level. Withallevery event reaches Rainbow Gum, which then applies its own levels, at the cost of aLogRecordfor every event including those Rainbow Gum does not log.
Property:
logging.jul.level- See Also:
-
-
Constructor Details
-
JULConfigurator
public JULConfigurator()For service laoder.
-
-
Method Details
-
configure
Description copied from interface:RainbowGumServiceProvider.ConfiguratorDo ad-hoc initialization before RainbowGum is fully loaded.- Specified by:
configurein interfaceRainbowGumServiceProvider.Configurator- Parameters:
config- config.pass- info on what pass this is.- Returns:
trueif all dependencies were found.
-
install
Will install the JUL handler if not disabled by properties. This method is currently exposed for testing purposes.- Parameters:
properties- properties to check- Returns:
- true if enabled.
-
isInstalled
Will test if already installed. This is mainly for testing purpsoes.- Returns:
- true if installed.
-
close
- Specified by:
closein interfaceAutoCloseable
-