
public abstract class WaarpLoggerFactory extends Object
WaarpLogger or changes the default factory
implementation. This factory allows you to choose what logging framework
VITAM should use. The default factory is WaarpSlf4JLoggerFactory. If SLF4J
is not available, WaarpSlf4JLoggerFactory is used. If Log4J is not available, WaarpJdkLoggerFactory is used. You can
change it to your preferred
logging framework before other VITAM classes are loaded:
Please note that the new default factory is effective only for the classes which were loaded after the default factory is changed. Therefore,WaarpLoggerFactory.setDefaultFactory(newWaarpSlf4JLoggerFactory());
setDefaultFactory(WaarpLoggerFactory) should be
called as early
as possible and shouldn't be called more than once.| Modifier and Type | Field and Description |
|---|---|
protected static WaarpLogLevel |
currentLevel |
| Constructor and Description |
|---|
WaarpLoggerFactory(WaarpLogLevel level) |
| Modifier and Type | Method and Description |
|---|---|
static WaarpLoggerFactory |
getDefaultFactory()
Returns the default factory.
|
static WaarpLogger |
getInstance(Class<?> clazz)
Creates a new logger instance with the name of the specified class.
|
static WaarpLogger |
getInstance(String name)
Creates a new logger instance with the specified name.
|
protected abstract WaarpLogLevel |
getLevelSpecific() |
static WaarpLogger |
getLogger(Class<?> clazz)
Creates a new logger instance with the name of the specified class.
|
static WaarpLogger |
getLogger(String name)
Creates a new logger instance with the specified name.
|
static WaarpLogLevel |
getLogLevel() |
protected abstract WaarpLogger |
newInstance(String name)
Creates a new logger instance with the specified name.
|
protected abstract void |
seLevelSpecific(WaarpLogLevel level)
Set the level for the specific implementation
|
static void |
setDefaultFactory(WaarpLoggerFactory defaultFactory)
Changes the default factory.
|
protected static void |
setInternalLogLevel(WaarpLogLevel level) |
static void |
setLogLevel(WaarpLogLevel level) |
protected static WaarpLogLevel currentLevel
public WaarpLoggerFactory(WaarpLogLevel level)
level - public static WaarpLoggerFactory getDefaultFactory()
WaarpJdkLoggerFactory.public static void setDefaultFactory(WaarpLoggerFactory defaultFactory)
defaultFactory - public static WaarpLogger getInstance(Class<?> clazz)
clazz - public static WaarpLogger getInstance(String name)
name - public static WaarpLogger getLogger(Class<?> clazz)
clazz - public static WaarpLogger getLogger(String name)
name - public static void setLogLevel(WaarpLogLevel level)
level - public static WaarpLogLevel getLogLevel()
protected static void setInternalLogLevel(WaarpLogLevel level)
protected abstract WaarpLogLevel getLevelSpecific()
protected abstract void seLevelSpecific(WaarpLogLevel level)
level - protected abstract WaarpLogger newInstance(String name)
Copyright © 2009–2019 Waarp. All rights reserved.