Package org.exoplatform.services.log
Class ExoLogger
java.lang.Object
org.exoplatform.services.log.ExoLogger
The logger definition for exo platform.
ExoLogger it's wrapping factory for different Log factories existing in runtime for eXo.
The logger implements the Log interface
for backward compatibility purpose.
This class is also the way to obtain a reference to a logger through the
static methods getExoLogger(String) and getExoLogger(Class)
.
ExoLogFactory that is determined by
the following rules
- A static instance is used and by default the static instance is assigned
with an instance of the class
SLF4JExoLogFactory. It is possible to change the instance at runtime by calling the static methodsetFactory(ExoLogFactory). - If the static instance fails to deliver a logger at runtime due to a
NoClassDefFoundErrorthen a factory instance of classSimpleExoLogFactoryis used for fail over.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggetExoLogger(Class name) Returns a specified logger.static LoggetExoLogger(String name) Returns a specified logger.static LogUse insteadgetExoLogger(Class).static LogUse insteadgetExoLogger(String).static voidsetFactory(ExoLogFactory factory) Configures the exo logger factory.
-
Constructor Details
-
ExoLogger
public ExoLogger()
-
-
Method Details
-
setFactory
Configures the exo logger factory. This method can be called multiple times to replace the current static instance.- Parameters:
factory- ExoLogFactory, the new factory- Throws:
IllegalArgumentException- when the factory is null
-
getLogger
Use insteadgetExoLogger(String).- Parameters:
name- String, the logger name- Returns:
- the logger
-
getLogger
Use insteadgetExoLogger(Class).- Parameters:
name- Class, the logger name- Returns:
- the logger
-
getExoLogger
Returns a specified logger.- Parameters:
name- the logger name- Returns:
- the logger
- Throws:
IllegalArgumentException- if the name is null
-
getExoLogger
Returns a specified logger.- Parameters:
name- the logger name- Returns:
- the logger
- Throws:
IllegalArgumentException- if the name is null
-