-
- All Implemented Interfaces:
public abstract class LoggerStandard logging methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumLogger.CategoryAn enumeration of different categories for log messages.
-
Method Summary
Modifier and Type Method Description static LoggergetLogger(Class<out Object> clazz)Create a logger for the specified class. static LoggergetLogger(String name)Create a logger for the specified name. static LoggergetLogger(Logger loggingDelegate, Logger levelDelegate)Creates a new Logger instance which performs logging through loggingDelegateand useslevelDelegateto configure its level.voidlogEntry()Logs an entry in the calling method. voidlogExit()Logs exiting the calling method booleanisTraceEnabled()Check if a message with a TRACE level would actually be logged by this logger. voidtrace(Object msg)Log a TRACE message. voidtrace(Object msg, Throwable t)Log a message, with associated Throwable information. booleanisDebugEnabled()Check if a message with a DEBUG level would actually be logged by this logger. voiddebug(Object msg)Log a DEBUG message. voiddebug(Object msg, Throwable t)Log a message, with associated Throwable information. booleanisInfoEnabled()Check if a message with an INFO level would actually be logged by this logger. voidinfo(Object msg)Log a INFO message. voidinfo(Object msg, Throwable t)Log a message, with associated Throwable information. booleanisWarnEnabled()Check if a message with a WARN level would actually be logged by this logger. voidwarn(Object msg)Log a WARN message. voidwarn(Object msg, Throwable t)Log a message, with associated Throwable information. voiderror(Object msg)Log a ERROR message. voiderror(Object msg, Throwable t)Log a message, with associated Throwable information. voidfatal(Object msg)Log a FATAL message. voidfatal(Object msg, Throwable t)Log a message, with associated Throwable information. voidsetLevelFatal()Set logging level for all handlers to FATAL voidsetLevelError()Set logging level for all handlers to ERROR voidsetLevelWarn()Set logging level for all handlers to WARNING voidsetLevelInfo()Set logging level for all handlers to INFO voidsetLevelDebug()Set logging level for all handlers to DEBUG voidsetLevelTrace()Set logging level for all handlers to TRACE voidsetLevelAll()Set logging level for all handlers to ALL (allow all log messages) voidsetLevelOff()Set logging level for all handlers to OFF (allow no log messages) voidreset()Reinitialize the logging properties and reread the logging configuration. abstract voidsetLevel(Level level)Set logging level for all handlers to level abstract LevelgetLevel()abstract voidlog(Level level, Object msg)Logs a message at a given level, if that level is loggable according to the log level configured by this instance. abstract voidlog(Level level, Object msg, Throwable thrown)Logs a message at a given level, if that level is loggable according to the log level configured by this instance. voidlog(Level level, Logger.Category category, String msg)Logs a given message with and given category at a given level, if that level is loggable according to the log level configured by this instance. voidlog(Level level, Logger.Category category, String msg, Throwable thrown)Logs a given message with and given category at a given level, if that level is loggable according to the log level configured by this instance. voiddebug(Logger.Category category, String msg)Log a message with debug level. voiddebug(Logger.Category category, String msg, Throwable t)Log a message with debug level, with associated Throwable information. voiderror(Logger.Category category, String msg)Log a message with error level. voiderror(Logger.Category category, String msg, Throwable t)Log a message with error level, with associated Throwable information. voidinfo(Logger.Category category, String msg, Throwable t)Log a message with info level, with associated Throwable information. voidinfo(Logger.Category category, String msg)Log a message with info level. -
-
Method Detail
-
getLogger
static Logger getLogger(Class<out Object> clazz)
Create a logger for the specified class.
- Parameters:
clazz- The class for which to create a logger.
-
getLogger
static Logger getLogger(Logger loggingDelegate, Logger levelDelegate)
Creates a new Logger instance which performs logging through
loggingDelegateand useslevelDelegateto configure its level.
-
logEntry
@Deprecated() void logEntry()
Logs an entry in the calling method.
-
logExit
@Deprecated() void logExit()
Logs exiting the calling method
-
isTraceEnabled
boolean isTraceEnabled()
Check if a message with a TRACE level would actually be logged by this logger.
-
trace
void trace(Object msg)
Log a TRACE message.
If the logger is currently enabled for the TRACE message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The message to log
-
trace
void trace(Object msg, Throwable t)
Log a message, with associated Throwable information.
- Parameters:
msg- The message to logt- Throwable associated with log message.
-
isDebugEnabled
boolean isDebugEnabled()
Check if a message with a DEBUG level would actually be logged by this logger.
-
debug
void debug(Object msg)
Log a DEBUG message.
If the logger is currently enabled for the DEBUG message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The message to log
-
debug
void debug(Object msg, Throwable t)
Log a message, with associated Throwable information.
- Parameters:
msg- The message to logt- Throwable associated with log message.
-
isInfoEnabled
boolean isInfoEnabled()
Check if a message with an INFO level would actually be logged by this logger.
-
info
void info(Object msg)
Log a INFO message.
If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The message to log
-
info
void info(Object msg, Throwable t)
Log a message, with associated Throwable information.
- Parameters:
msg- The message to logt- Throwable associated with log message.
-
isWarnEnabled
boolean isWarnEnabled()
Check if a message with a WARN level would actually be logged by this logger.
-
warn
void warn(Object msg)
Log a WARN message.
If the logger is currently enabled for the WARN message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The message to log
-
warn
void warn(Object msg, Throwable t)
Log a message, with associated Throwable information.
- Parameters:
msg- The message to logt- Throwable associated with log message.
-
error
void error(Object msg)
Log a ERROR message.
If the logger is currently enabled for the ERROR message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The message to log
-
error
void error(Object msg, Throwable t)
Log a message, with associated Throwable information.
- Parameters:
msg- The message to logt- Throwable associated with log message.
-
fatal
void fatal(Object msg)
Log a FATAL message.
If the logger is currently enabled for the FATAL message level then the given message is forwarded to all the registered output Handler objects.
- Parameters:
msg- The message to log
-
fatal
void fatal(Object msg, Throwable t)
Log a message, with associated Throwable information.
- Parameters:
msg- The message to logt- Throwable associated with log message.
-
setLevelFatal
void setLevelFatal()
Set logging level for all handlers to FATAL
-
setLevelError
void setLevelError()
Set logging level for all handlers to ERROR
-
setLevelWarn
void setLevelWarn()
Set logging level for all handlers to WARNING
-
setLevelInfo
void setLevelInfo()
Set logging level for all handlers to INFO
-
setLevelDebug
void setLevelDebug()
Set logging level for all handlers to DEBUG
-
setLevelTrace
void setLevelTrace()
Set logging level for all handlers to TRACE
-
setLevelAll
void setLevelAll()
Set logging level for all handlers to ALL (allow all log messages)
-
setLevelOff
void setLevelOff()
Set logging level for all handlers to OFF (allow no log messages)
-
reset
void reset()
Reinitialize the logging properties and reread the logging configuration.
The same rules are used for locating the configuration properties as are used at startup. So if the properties containing the log dir locations have changed, we would read the new configuration.
-
setLevel
abstract void setLevel(Level level)
Set logging level for all handlers to level
- Parameters:
level- the level to set for all logger handlers
-
log
abstract void log(Level level, Object msg)
Logs a message at a given level, if that level is loggable according to the log level configured by this instance.
- Parameters:
level- the level at which to log the message.msg- the message to log.
-
log
abstract void log(Level level, Object msg, Throwable thrown)
Logs a message at a given level, if that level is loggable according to the log level configured by this instance.
- Parameters:
level- the level at which to log the message.msg- the message to log.thrown- a Throwable associated with log message.
-
log
void log(Level level, Logger.Category category, String msg)
Logs a given message with and given category at a given level, if that level is loggable according to the log level configured by this instance. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
level- the level at which to log the message.category- the category.msg- the message to log.
-
log
void log(Level level, Logger.Category category, String msg, Throwable thrown)
Logs a given message with and given category at a given level, if that level is loggable according to the log level configured by this instance. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
level- the level at which to log the message.category- the category.msg- the message to log.thrown- a Throwable associated with log message.
-
debug
void debug(Logger.Category category, String msg)
Log a message with debug level. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
category- the category.msg- The message to log
-
debug
void debug(Logger.Category category, String msg, Throwable t)
Log a message with debug level, with associated Throwable information. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
category- the category.msg- The message to logt- Throwable associated with log message.
-
error
void error(Logger.Category category, String msg)
Log a message with error level. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
category- the category.msg- The message to log
-
error
void error(Logger.Category category, String msg, Throwable t)
Log a message with error level, with associated Throwable information. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
category- the category.msg- The message to logt- Throwable associated with log message.
-
info
void info(Logger.Category category, String msg, Throwable t)
Log a message with info level, with associated Throwable information. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
category- the category.msg- The message to logt- Throwable associated with log message.
-
info
void info(Logger.Category category, String msg)
Log a message with info level. An identifier of the category in the form of CAT=name will will simply be prepended to the message.
- Parameters:
category- the category.msg- The message to log
-
-
-
-