Class SysLoggerFactory
- java.lang.Object
-
- org.silverpeas.core.util.logging.sys.SysLoggerFactory
-
- All Implemented Interfaces:
SilverLoggerFactory
public class SysLoggerFactory extends Object implements SilverLoggerFactory
Implementation of theorg.silverpeas.core.util.logging.LoggerFactory
interface to provide a logger wrapping the default Java logger. It manages a cache oforg.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 Summary
Constructors Constructor Description SysLoggerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SilverLogger
getLogger(String namespace, LoggerConfigurationManager.LoggerConfiguration configuration)
Gets aSilverLogger
instance for the specified namespace.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.util.logging.SilverLoggerFactory
getLogger
-
-
-
-
Method Detail
-
getLogger
public SilverLogger getLogger(String namespace, LoggerConfigurationManager.LoggerConfiguration configuration)
Description copied from interface:SilverLoggerFactory
Gets aSilverLogger
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 interfaceSilverLoggerFactory
- 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 insteadLoggerConfigurationManager
.- Returns:
- a Silverpeas logger instance.
-
-