Class LoggingModule
java.lang.Object
com.google.inject.AbstractModule
com.peterphi.std.guice.common.logging.LoggingModule
- All Implemented Interfaces:
com.google.inject.Module,GuiceConfigChangeObserver
public class LoggingModule
extends com.google.inject.AbstractModule
implements GuiceConfigChangeObserver
Reads the
If the log4j.properties property is not specified then the default behaviour is observed (log4j configures itself automatically)
log4j.properties value from the service config; if a value is supplied it searches the classpath for
this and loads it into log4j.If the log4j.properties property is not specified then the default behaviour is observed (log4j configures itself automatically)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidautoReconfigure(GuiceConfig guice) protected voidstatic booleanstatic PropertyFilegetProperties(GuiceConfig guice) static voidmanualReconfigure(GuiceConfig guice) static voidpreconfigure(GuiceConfig config) Attempt to configure the logging system before the environment is fully prepared
Will be subsequently reconfigured by the LoggingModule being constructedvoidpropertyChanged(String name) Fired when the configured value for a property changes.static StringreadLogbackConfig(GuiceConfig config) static voidsetAllowAutoReconfigure(boolean value) Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Field Details
-
DEFAULT_OUTPUT_PATTERN
- See Also:
-
-
Constructor Details
-
LoggingModule
-
-
Method Details
-
configure
protected void configure()- Overrides:
configurein classcom.google.inject.AbstractModule
-
manualReconfigure
-
autoReconfigure
-
setAllowAutoReconfigure
public static void setAllowAutoReconfigure(boolean value) -
getAllowAutoReconfigure
public static boolean getAllowAutoReconfigure() -
preconfigure
Attempt to configure the logging system before the environment is fully prepared
Will be subsequently reconfigured by the LoggingModule being constructed- Parameters:
config-
-
readLogbackConfig
-
getProperties
-
propertyChanged
Description copied from interface:GuiceConfigChangeObserverFired when the configured value for a property changes.- Specified by:
propertyChangedin interfaceGuiceConfigChangeObserver- Parameters:
name- the property name. Will never be null.
-