Class SysLoggerFactory

  • All Implemented Interfaces:
    SilverLoggerFactory

    public class SysLoggerFactory
    extends Object
    implements SilverLoggerFactory
    Implementation of the org.silverpeas.core.util.logging.LoggerFactory interface to provide a logger wrapping the default Java logger.

    It manages a cache of org.silverpeas.core.util.logging.sys.SysLogger instances that were already previously asked. If a logger isn't in the cache, then it manufactures it, initializes it from its logging configuration, and puts it into the cache.
    Author:
    miguel
    • Constructor Detail

      • SysLoggerFactory

        public SysLoggerFactory()
    • Method Detail

      • getLogger

        public SilverLogger getLogger​(String namespace,
                                      LoggerConfigurationManager.LoggerConfiguration configuration)
        Description copied from interface: SilverLoggerFactory
        Gets a SilverLogger instance for the specified namespace. If a logger has already been created with the given namespace it is returned, otherwise a new logger is manufactured and initialized from the given logger configuration.

        The logging level of the returned logger will be set according to the specified logging configuration. If no level setting is found from the configuration or if there is no configuration found for the specified namespace, then the logger level is set to null meaning it should inherit its level from its nearest ancestor with a specific (non-null) level value. It is the responsibility of the implementation of the logger to take care of the logging level inheritance and of the default log handlers/adapters used by Silverpeas.

        This method should not be invoked directly. It is dedicated to be used by the SilverLogger.getLogger(String) method or by the implementation of the Silverpeas Logging Engine.

        Specified by:
        getLogger in interface SilverLoggerFactory
        Parameters:
        namespace - the hierarchical dot-separated namespace of the logger mapping the hierachical relationships between the loggers from the root one.
        configuration - the logger configuration to use when initializing the manufactured logger. If the logger already exists, the configuration won't be used in order to avoid any replacement of the existing configuration. To update its configuration, please use instead LoggerConfigurationManager.
        Returns:
        a Silverpeas logger instance.