|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectLoggerFactory<L>
L - The type of loggers used for the implementation backend. This is the type
used by external frameworks like Log4J.@ThreadSafe public abstract class LoggerFactory<L>
A factory for Java Logger wrapping an other logging framework. This factory is used
only when wanting to log to an other framework than Java logging. The getLogger(String)
method returns some subclass of Logger (typically LoggerAdapter) that
forward directly all log methods to an other framework.
Logging,
LoggerAdapter
| utility/geotk-utility (download) | View source code for this class |
| Field Summary | |
|---|---|
static String |
COMMONS_LOGGING
Deprecated. Deprecated together with Logging.setLoggerFactory(String). |
static String |
LOG4J
Deprecated. Deprecated together with Logging.setLoggerFactory(String). |
| Constructor Summary | |
|---|---|
protected |
LoggerFactory(Class<L> loggerClass)
Creates a new factory. |
| Method Summary | |
|---|---|
protected abstract L |
getImplementation(String name)
Returns the implementation to use for the logger of the specified name. |
Class<L> |
getImplementationClass()
Returns the base class of objects to be returned by getImplementation(java.lang.String). |
Logger |
getLogger(String name)
Returns the logger of the specified name, or null. |
protected abstract L |
unwrap(Logger logger)
Returns the implementation wrapped by the specified logger, or null if none. |
protected abstract Logger |
wrap(String name,
L implementation)
Wraps the specified implementation in a Java logger. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Deprecated public static final String COMMONS_LOGGING
Logging.setLoggerFactory(String).Logging.setLoggerFactory(String) in order to force explicitly
usage of this logging framework. Note that this is usually not needed, since this framework is
selected automatically if geotk-logging-commons.jar is found on the classpath.
Logging.setLoggerFactory(String),
Constant Field Values@Deprecated public static final String LOG4J
Logging.setLoggerFactory(String).Logging.setLoggerFactory(String) in order to force explicitly usage of this logging
framework. Note that this is usually not needed, since this framework is selected automatically
if geotk-logging-log4j.jar is found on the classpath.
Logging.setLoggerFactory(String),
Constant Field Values| Constructor Detail |
|---|
protected LoggerFactory(Class<L> loggerClass)
loggerClass - The class of the wrapped logger.| Method Detail |
|---|
public Logger getLogger(String name)
null. If this method has already been
invoked previously with the same name argument, then it may returns the same logger
provided that:
getImplementation(name) has
not changed.
Otherwise this method returns a new Logger instance, or null if the
standard Java logging framework should be used.
name - The name of the logger.
null.public Class<L> getImplementationClass()
getImplementation(java.lang.String). The
class depends on the underlying logging framework (Log4J, SLF4J, etc.).
protected abstract L getImplementation(String name)
null since we should not use wrapper at all.
name - The name of the logger.
null if the target framework would redirect
to the Java logging framework.
protected abstract Logger wrap(String name,
L implementation)
name - The name of the logger.implementation - An implementation returned by getImplementation(java.lang.String).
protected abstract L unwrap(Logger logger)
null if none. If the specified logger is not an instance of the expected class,
then this method should returns null.
logger - The logger to test.
null if none.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||