Package com.restfb.logging
Class RestFBLogger
- java.lang.Object
-
- com.restfb.logging.RestFBLogger
-
- Direct Known Subclasses:
JulLogger
,SLF4JLogger
public abstract class RestFBLogger extends Object
Abstract class that is the parent of all our logger implementations.Normally RestFB uses java.util.logging for logging messages. But as soon as slf4j is found on the class path RestFB switches to this logger. With the slf4j facade more logger implementations are supported and the quasi standard for java logging is used.
In the rare case you have to switch to java.util.logging although slf4j is present on the class path we provide a system property to force java.util.logging to be used.
The system property is called
com.restfb.forceJUL
and can be set totrue
if jul should be forced.
-
-
Field Summary
Fields Modifier and Type Field Description static RestFBLogger
CLIENT_LOGGER
static RestFBLogger
HTTP_LOGGER
static RestFBLogger
MAPPER_LOGGER
static RestFBLogger
UTILS_LOGGER
static RestFBLogger
VALUE_FACTORY_LOGGER
-
Constructor Summary
Constructors Constructor Description RestFBLogger()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
debug(String msg, Object... args)
Log a message at the DEBUG level according to the specified format and arguments.abstract void
error(String msg, Object... args)
Log a message at the ERROR level according to the specified format and arguments.abstract void
fatal(String msg, Object... args)
Log a message at the FATAL level according to the specified format and arguments.static RestFBLogger
getLoggerInstance(String logCategory)
returns the instance of the logger that belongs to the category.abstract void
info(String msg, Object... args)
Log a message at the INFO level according to the specified format and arguments.abstract boolean
isDebugEnabled()
Is the logger instance enabled for the DEBUG level?abstract boolean
isInfoEnabled()
Is the logger instance enabled for the INFO level?abstract boolean
isTraceEnabled()
Is the logger instance enabled for the TRACE level?abstract void
trace(String msg, Object... args)
Log a message at the TRACE level according to the specified format and arguments.abstract void
warn(String msg, Object... args)
Log a message at the WARN level according to the specified format and arguments.
-
-
-
Field Detail
-
HTTP_LOGGER
public static final RestFBLogger HTTP_LOGGER
-
MAPPER_LOGGER
public static final RestFBLogger MAPPER_LOGGER
-
UTILS_LOGGER
public static final RestFBLogger UTILS_LOGGER
-
CLIENT_LOGGER
public static final RestFBLogger CLIENT_LOGGER
-
VALUE_FACTORY_LOGGER
public static final RestFBLogger VALUE_FACTORY_LOGGER
-
-
Constructor Detail
-
RestFBLogger
public RestFBLogger()
-
-
Method Detail
-
getLoggerInstance
public static RestFBLogger getLoggerInstance(String logCategory)
returns the instance of the logger that belongs to the category.- Parameters:
logCategory
- the category of the logger- Returns:
- a instance of the logger
-
trace
public abstract void trace(String msg, Object... args)
Log a message at the TRACE level according to the specified format and arguments.- Parameters:
msg
- the log messageargs
- optional arguments, the last argument may be an exception
-
debug
public abstract void debug(String msg, Object... args)
Log a message at the DEBUG level according to the specified format and arguments.- Parameters:
msg
- the log messageargs
- optional arguments, the last argument may be an exception
-
info
public abstract void info(String msg, Object... args)
Log a message at the INFO level according to the specified format and arguments.- Parameters:
msg
- the log messageargs
- optional arguments, the last argument may be an exception
-
warn
public abstract void warn(String msg, Object... args)
Log a message at the WARN level according to the specified format and arguments.- Parameters:
msg
- the log messageargs
- optional arguments, the last argument may be an exception
-
error
public abstract void error(String msg, Object... args)
Log a message at the ERROR level according to the specified format and arguments.- Parameters:
msg
- the log messageargs
- optional arguments, the last argument may be an exception
-
fatal
public abstract void fatal(String msg, Object... args)
Log a message at the FATAL level according to the specified format and arguments.- Parameters:
msg
- the log messageargs
- optional arguments, the last argument may be an exception
-
isDebugEnabled
public abstract boolean isDebugEnabled()
Is the logger instance enabled for the DEBUG level?- Returns:
true
if it is enabled,false
otherwise
-
isInfoEnabled
public abstract boolean isInfoEnabled()
Is the logger instance enabled for the INFO level?- Returns:
true
if it is enabled,false
otherwise
-
isTraceEnabled
public abstract boolean isTraceEnabled()
Is the logger instance enabled for the TRACE level?- Returns:
true
if it is enabled,false
otherwise
-
-