Package org.exoplatform.services.log
Class ExoLogger
- java.lang.Object
-
- org.exoplatform.services.log.ExoLogger
-
public abstract class ExoLogger extends Object
The logger definition for exo platform.ExoLogger it's wrapping factory for different Log factories existing in runtime for eXo.
The logger implements theLoginterface for backward compatibility purpose.This class is also the way to obtain a reference to a logger through the static methods
The factory methods delegates to an instance ofgetExoLogger(String)andgetExoLogger(Class).ExoLogFactorythat 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.
- Version:
- $Id: ExoLogger.java 34394 2009-07-23 09:23:31Z dkatayev $
- Author:
- Gennady Azarenkov
- A static instance is used and by default the static instance is assigned
with an instance of the class
-
-
Constructor Summary
Constructors Constructor Description ExoLogger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LoggetExoLogger(Class name)Returns a specified logger.static LoggetExoLogger(String name)Returns a specified logger.static LoggetLogger(Class name)Use insteadgetExoLogger(Class).static LoggetLogger(String name)Use insteadgetExoLogger(String).static voidsetFactory(ExoLogFactory factory)Configures the exo logger factory.
-
-
-
Method Detail
-
setFactory
public static void setFactory(ExoLogFactory factory) throws IllegalArgumentException
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
public static Log getLogger(String name)
Use insteadgetExoLogger(String).- Parameters:
name- String, the logger name- Returns:
- the logger
-
getLogger
public static Log getLogger(Class name)
Use insteadgetExoLogger(Class).- Parameters:
name- Class, the logger name- Returns:
- the logger
-
getExoLogger
public static Log getExoLogger(String name) throws IllegalArgumentException
Returns a specified logger.- Parameters:
name- the logger name- Returns:
- the logger
- Throws:
IllegalArgumentException- if the name is null
-
getExoLogger
public static Log getExoLogger(Class name) throws IllegalArgumentException
Returns a specified logger.- Parameters:
name- the logger name- Returns:
- the logger
- Throws:
IllegalArgumentException- if the name is null
-
-