Class LoggerFactory

java.lang.Object
de.iip_ecosphere.platform.support.logging.LoggerFactory

public abstract class LoggerFactory extends Object
Creates loggers. By default, provides a fallback logger implementation. The format for parameterized log messages is that of SLF4J, i.e., {} in the message are substituted in the order of given arguments.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • LoggerFactory

      public LoggerFactory()
  • Method Details

    • considerPlugin

      public static void considerPlugin()
      Loads the logger factory plugin if present.
    • setLoggerFactory

      public static void setLoggerFactory(ILoggerFactory fcty)
      Changes the logger factory.
      Parameters:
      fcty - the new factory, ignored if null
    • getLoggerFactory

      public static ILoggerFactory getLoggerFactory()
      Returns the actual logger factory.
      Returns:
      the factory
    • getLogger

      public static Logger getLogger(String name)
      Return a logger named according to the name parameter using the statically bound ILoggerFactory instance.
      Parameters:
      name - The name of the logger.
      Returns:
      logger
    • getLogger

      public static Logger getLogger(Class<?> cls)
      Return a logger named corresponding to the class passed as parameter.
      Parameters:
      cls - the returned logger will be named after cls
      Returns:
      the logger instance
    • getLogger

      public static Logger getLogger(Object object)
      Return a logger named corresponding to the object passed as parameter. [convenience]
      Parameters:
      object - the object the logger will be named after; if object is a class, then the object is directly passed to getLogger(Class), else if not null the class of object is taken
      Returns:
      the logger instance