Class LoggerFactory
java.lang.Object
de.iip_ecosphere.platform.support.logging.LoggerFactory
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static ILoggerFactoryprivate static final ILoggerFactoryprivate static final LogLevel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLoads the logger factory plugin if present.static LoggerReturn a logger named corresponding to the class passed as parameter.static LoggerReturn a logger named corresponding to the object passed as parameter.static LoggerReturn a logger named according to the name parameter using the statically boundILoggerFactoryinstance.static ILoggerFactoryReturns the actual logger factory.static voidChanges the logger factory.
-
Field Details
-
LEVEL
-
loggers
-
FALLBACK_FACTORY
-
factory
-
-
Constructor Details
-
LoggerFactory
public LoggerFactory()
-
-
Method Details
-
considerPlugin
public static void considerPlugin()Loads the logger factory plugin if present. -
setLoggerFactory
Changes the logger factory.- Parameters:
fcty- the new factory, ignored if null
-
getLoggerFactory
Returns the actual logger factory.- Returns:
- the factory
-
getLogger
Return a logger named according to the name parameter using the statically boundILoggerFactoryinstance.- Parameters:
name- The name of the logger.- Returns:
- logger
-
getLogger
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
Return a logger named corresponding to the object passed as parameter. [convenience]- Parameters:
object- the object the logger will be named after; ifobjectis a class, then the object is directly passed togetLogger(Class), else if not null the class of object is taken- Returns:
- the logger instance
-