Package org.geotools.util.logging
Class Log4JLogger
- Object
-
- Logger
-
- LoggerAdapter
-
- Log4JLogger
-
public final class Log4JLogger extends LoggerAdapter
An adapter that redirect all Java logging events to the Apache's Log4J framework.Level.OFF
:Level.ALL
Level.SEVERE
:Level.ERROR
Level.WARNING
Level.WARN
Level.INFO
:Level.INFO
Level.CONFIG
:CONFIG
Level.FINE
:Level.DEBUG
Level.FINER
:Level.TRACE
Level.FINEST
:FINEST
Level.OFF
:Level.ALL
- Since:
- 2.4
- Author:
- Martin Desruisseaux, Saul Farber (MassGIS)
- See Also:
Log4JLoggerFactory
,Logging
-
-
Field Summary
Fields Modifier and Type Field Description static Level
CONFIG
Maps to Java Utility LoggingLevel.CONFIG
, showing up below INFO messages when used in Log4J setup.static Level
FINEST
Maps to Java Utility LoggingLevel.FINEST
, showing up below TRACE messages when used in Log4J setup-
Fields inherited from class Logger
global, GLOBAL_LOGGER_NAME
-
-
Constructor Summary
Constructors Constructor Description Log4JLogger(String name, Logger logger)
Creates a new logger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config(String message)
Logs anCONFIG
message.void
fine(String message)
Logs aFINE
message.void
finer(String message)
Logs aFINER
message.void
finest(String message)
Logs aFINEST
message.Level
getLevel()
Returns the level for this logger.void
info(String message)
Logs anINFO
message.boolean
isLoggable(Level level)
Returnstrue
if the specified level is loggable.void
log(Level level, String message)
Logs a record at the specified level.void
log(Level level, String message, Throwable thrown)
Logs a record at the specified level.void
setLevel(Level level)
Set the level for this logger.void
severe(String message)
Logs aSEVERE
message.String
toString()
void
warning(String message)
Logs aWARNING
message.-
Methods inherited from class LoggerAdapter
addHandler, entering, entering, entering, exiting, exiting, getDebugLevel, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setParent, setUseParentHandlers, throwing
-
Methods inherited from class Logger
config, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, log, log, logp, logp, logrb, logrb, logrb, logrb, setResourceBundle, severe, warning
-
-
-
-
Field Detail
-
CONFIG
public static final Level CONFIG
Maps to Java Utility LoggingLevel.CONFIG
, showing up below INFO messages when used in Log4J setup.
-
FINEST
public static final Level FINEST
Maps to Java Utility LoggingLevel.FINEST
, showing up below TRACE messages when used in Log4J setup
-
-
Constructor Detail
-
Log4JLogger
public Log4JLogger(String name, Logger logger)
Creates a new logger.- Parameters:
name
- The logger name.logger
- The result ofLogger.getLogger(name)
.
-
-
Method Detail
-
setLevel
public void setLevel(Level level)
Set the level for this logger.- Specified by:
setLevel
in classLoggerAdapter
-
getLevel
public Level getLevel()
Returns the level for this logger.- Specified by:
getLevel
in classLoggerAdapter
-
isLoggable
public boolean isLoggable(Level level)
Returnstrue
if the specified level is loggable.- Specified by:
isLoggable
in classLoggerAdapter
-
log
public void log(Level level, String message)
Logs a record at the specified level.- Overrides:
log
in classLoggerAdapter
-
log
public void log(Level level, String message, Throwable thrown)
Logs a record at the specified level.- Overrides:
log
in classLoggerAdapter
-
severe
public void severe(String message)
Description copied from class:LoggerAdapter
Logs aSEVERE
message.- Specified by:
severe
in classLoggerAdapter
-
warning
public void warning(String message)
Description copied from class:LoggerAdapter
Logs aWARNING
message.- Specified by:
warning
in classLoggerAdapter
-
info
public void info(String message)
Description copied from class:LoggerAdapter
Logs anINFO
message.- Specified by:
info
in classLoggerAdapter
-
config
public void config(String message)
Description copied from class:LoggerAdapter
Logs anCONFIG
message.- Specified by:
config
in classLoggerAdapter
-
fine
public void fine(String message)
Description copied from class:LoggerAdapter
Logs aFINE
message.- Specified by:
fine
in classLoggerAdapter
-
finer
public void finer(String message)
Description copied from class:LoggerAdapter
Logs aFINER
message.- Specified by:
finer
in classLoggerAdapter
-
finest
public void finest(String message)
Description copied from class:LoggerAdapter
Logs aFINEST
message.- Specified by:
finest
in classLoggerAdapter
-
toString
public String toString()
- Overrides:
toString
in classLoggerAdapter
-
-