public class LoggerFactoryProvider
extends java.lang.Object
The name of the default factory binding can be set via the system property "org.pfsw.logging.binding". If this property is not specified, the default factory will be "STDOUT".
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDefaultFactoryName() |
static Logger |
getLogger(java.lang.Class<?> clazz)
Returns a logger instance corresponding to the full qualifies name of the given class.
|
static Logger |
getLogger(java.lang.String loggerName)
Returns a logger instance corresponding to the given name.
|
static Logger2 |
getLogger2(java.lang.Class<?> clazz)
Returns a logger instance corresponding to the full qualifies name of the given class.
|
static Logger2 |
getLogger2(java.lang.String loggerName)
Returns a logger instance corresponding to the given name.
|
static LoggerFactory |
getLoggerFactory()
Returns the default logger factory (i.e.
|
static LoggerFactory |
getLoggerFactory(java.lang.String name)
Returns the logger factory with the given name or, if it cannot be found,
a special factory that produces logger that do all logging to
stdout and try to load the desired factory later, as soon as
it is available.
|
static void |
register(LoggerFactory factory)
Registers the given factory under its name (see
LoggerFactory.getName() ). |
static void |
reset()
Resets the default logger factory name to the value of system property
"org.pfsw.logging.binding" or to "STDOUT".
|
static void |
setDefaultFactoryName(java.lang.String name) |
public static Logger getLogger(java.lang.Class<?> clazz)
This will use the LoggerFactory provided by getLoggerFactory()
.
public static Logger getLogger(java.lang.String loggerName)
This will use the LoggerFactory provided by getLoggerFactory()
.
public static Logger2 getLogger2(java.lang.Class<?> clazz)
This will use the LoggerFactory provided by getLoggerFactory()
.
public static Logger2 getLogger2(java.lang.String loggerName)
This will use the LoggerFactory provided by getLoggerFactory()
.
public static LoggerFactory getLoggerFactory()
public static LoggerFactory getLoggerFactory(java.lang.String name)
name
- The unique name of the logger factory type (must not be null).java.lang.IllegalArgumentException
- If the given name is null.public static void reset()
public static java.lang.String getDefaultFactoryName()
public static void setDefaultFactoryName(java.lang.String name)
public static void register(LoggerFactory factory)
LoggerFactory.getName()
).