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 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 Details

  • Constructor Details

    • LoggingModule

      public LoggingModule(GuiceConfig configuration)
  • Method Details

    • configure

      protected void configure()
      Overrides:
      configure in class com.google.inject.AbstractModule
    • manualReconfigure

      public static void manualReconfigure(GuiceConfig guice)
    • autoReconfigure

      public static void autoReconfigure(GuiceConfig guice)
    • setAllowAutoReconfigure

      public static void setAllowAutoReconfigure(boolean value)
    • getAllowAutoReconfigure

      public static boolean getAllowAutoReconfigure()
    • preconfigure

      public 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 constructed
      Parameters:
      config -
    • readLogbackConfig

      public static String readLogbackConfig(GuiceConfig config)
    • getProperties

      public static PropertyFile getProperties(GuiceConfig guice)
    • propertyChanged

      public void propertyChanged(String name)
      Description copied from interface: GuiceConfigChangeObserver
      Fired when the configured value for a property changes.
      Specified by:
      propertyChanged in interface GuiceConfigChangeObserver
      Parameters:
      name - the property name. Will never be null.