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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
autoReconfigure
(GuiceConfig guice) protected void
static boolean
static PropertyFile
getProperties
(GuiceConfig guice) static void
manualReconfigure
(GuiceConfig guice) static void
preconfigure
(GuiceConfig config) Attempt to configure the logging system before the environment is fully prepared
Will be subsequently reconfigured by the LoggingModule being constructedvoid
propertyChanged
(String name) Fired when the configured value for a property changes.static String
readLogbackConfig
(GuiceConfig config) static void
setAllowAutoReconfigure
(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:
configure
in 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:GuiceConfigChangeObserver
Fired when the configured value for a property changes.- Specified by:
propertyChanged
in interfaceGuiceConfigChangeObserver
- Parameters:
name
- the property name. Will never be null.
-