Package org.geotools.util.logging
Class DefaultLoggerFactory
- Object
-
- LoggerFactory<Logger>
-
- DefaultLoggerFactory
-
public class DefaultLoggerFactory extends LoggerFactory<Logger>
Default LoggerFactory using java util logging framework directly.This is a no-op factory placeholder delegating directly to the java util logging framework. It is used by
Logging
as a default (rather than null {@link null}).- Author:
- Jody Garnett (GeoCat)
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultLoggerFactory()
Constructs a default factory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Logger
getImplementation(String name)
Returns the implementation to use for the logger of the specified name, ornull
if the logger would delegate to Java logging anyway.static DefaultLoggerFactory
getInstance()
Returns the unique instance of this factory.String
lookupConfiguration()
Look up configuration information, ornull
unknown.protected Logger
unwrap(Logger logger)
Returns the implementation wrapped by the specified logger, ornull
if none.protected Logger
wrap(String name, Logger implementation)
Wraps the specified implementation in a Java logger.-
Methods inherited from class LoggerFactory
getImplementationClass, getLogger
-
-
-
-
Method Detail
-
getInstance
public static DefaultLoggerFactory getInstance()
Returns the unique instance of this factory.
-
getImplementation
protected Logger getImplementation(String name)
Returns the implementation to use for the logger of the specified name, ornull
if the logger would delegate to Java logging anyway.- Specified by:
getImplementation
in classLoggerFactory<Logger>
- Parameters:
name
- The name of the logger.- Returns:
- The logger as an object of the target logging framework (Log4J, SLF4J,
etc.), or
null
if the target framework would redirect to the Java logging framework.
-
wrap
protected Logger wrap(String name, Logger implementation)
Wraps the specified implementation in a Java logger.- Specified by:
wrap
in classLoggerFactory<Logger>
- Parameters:
name
- The name of the logger.implementation
- An implementation returned byLoggerFactory.getImplementation(java.lang.String)
.- Returns:
- A new logger wrapping the specified implementation.
-
unwrap
protected Logger unwrap(Logger logger)
Returns the implementation wrapped by the specified logger, ornull
if none.- Specified by:
unwrap
in classLoggerFactory<Logger>
- Parameters:
logger
- The logger to test.- Returns:
- The implementation wrapped by the specified logger, or
null
if none.
-
lookupConfiguration
public String lookupConfiguration()
Description copied from class:LoggerFactory
Look up configuration information, ornull
unknown.Report back details on how logging configuration is setup. Ideally including configuration filename along with any system properties used.
- Overrides:
lookupConfiguration
in classLoggerFactory<Logger>
- Returns:
- configuration information, or
null
unknown.
-
-