- java.lang.Object
-
- com.sun.istack.logging.Logger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
config(String message)
void
config(String message, Object[] params)
void
config(String message, Throwable thrown)
void
entering()
void
entering(Object... parameters)
void
exiting()
void
exiting(Object result)
void
fine(String message)
void
fine(String message, Throwable thrown)
void
finer(String message)
void
finer(String message, Object[] params)
void
finer(String message, Throwable thrown)
void
finest(String message)
void
finest(String message, Object[] params)
void
finest(String message, Throwable thrown)
static Logger
getLogger(Class<?> componentClass)
The factory method returns preconfigured Logger wrapper for the class.static Logger
getLogger(String customLoggerName, Class<?> componentClass)
The factory method returns preconfigured Logger wrapper for the class.void
info(String message)
void
info(String message, Object[] params)
void
info(String message, Throwable thrown)
boolean
isLoggable(Level level)
boolean
isMethodCallLoggable()
void
log(Level level, String message)
void
log(Level level, String message, Object param1)
void
log(Level level, String message, Object[] params)
void
log(Level level, String message, Throwable thrown)
<T extends Throwable>
TlogException(T exception, boolean logCause, Level level)
Method logsexception
's message at the logging level specified by thelevel
argument.<T extends Throwable>
TlogException(T exception, Throwable cause, Level level)
Method logsexception
's message at the logging level specified by thelevel
argument.<T extends Throwable>
TlogException(T exception, Level level)
Same aslogException(exception, true, level)
.<T extends Throwable>
TlogSevereException(T exception)
Same aslogSevereException(exception, true)
.<T extends Throwable>
TlogSevereException(T exception, boolean logCause)
Method logsexception
's message as aSEVERE
logging level message.<T extends Throwable>
TlogSevereException(T exception, Throwable cause)
Method logsexception
's message as aSEVERE
logging level message.void
setLevel(Level level)
void
severe(String message)
void
severe(String message, Object[] params)
void
severe(String message, Throwable thrown)
void
warning(String message)
void
warning(String message, Object[] params)
void
warning(String message, Throwable thrown)
-
-
-
Method Detail
-
getLogger
@NotNull public static Logger getLogger(@NotNull Class<?> componentClass)
The factory method returns preconfigured Logger wrapper for the class. Method calls
getSystemLoggerName(java.lang.Class)
to generate default logger name.Since there is no caching implemented, it is advised that the method is called only once per a class in order to initialize a final static logger variable, which is then used through the class to perform actual logging tasks.
- Parameters:
componentClass
- class of the component that will use the logger instance. Must not benull
.- Returns:
- logger instance preconfigured for use with the component
- Throws:
NullPointerException
- if the componentClass parameter isnull
.
-
getLogger
@NotNull public static Logger getLogger(@NotNull String customLoggerName, @NotNull Class<?> componentClass)
The factory method returns preconfigured Logger wrapper for the class. Since there is no caching implemented, it is advised that the method is called only once per a class in order to initialize a final static logger variable, which is then used through the class to perform actual logging tasks. This method should be only used in a special cases when overriding of a default logger name derived from the package of the component class is needed. For all common use cases please usegetLogger(java.lang.Class)
method.- Parameters:
customLoggerName
- custom name of the logger.componentClass
- class of the component that will use the logger instance. Must not benull
.- Returns:
- logger instance preconfigured for use with the component
- Throws:
NullPointerException
- if the componentClass parameter isnull
.- See Also:
getLogger(java.lang.Class)
-
finest
public void finest(String message)
-
finer
public void finer(String message)
-
fine
public void fine(String message)
-
info
public void info(String message)
-
config
public void config(String message)
-
warning
public void warning(String message)
-
severe
public void severe(String message)
-
isMethodCallLoggable
public boolean isMethodCallLoggable()
-
isLoggable
public boolean isLoggable(Level level)
-
setLevel
public void setLevel(Level level)
-
entering
public void entering()
-
entering
public void entering(Object... parameters)
-
exiting
public void exiting()
-
exiting
public void exiting(Object result)
-
logSevereException
public <T extends Throwable> T logSevereException(T exception, Throwable cause)
Method logsexception
's message as aSEVERE
logging level message.If
cause
parameter is notnull
, it is logged as well andexception
original cause is initialized with instance referenced bycause
parameter.- Type Parameters:
T
- type- Parameters:
exception
- exception whose message should be logged. Must not benull
.cause
- initial cause of the exception that should be logged as well and set asexception
's original cause. May benull
.- Returns:
- the same exception instance that was passed in as the
exception
parameter.
-
logSevereException
public <T extends Throwable> T logSevereException(T exception, boolean logCause)
Method logsexception
's message as aSEVERE
logging level message.If
logCause
parameter istrue
,exception
's original cause is logged as well (if exists). This may be used in cases whenexception
's class provides constructor to initialize the original cause. In such case you do not need to uselogSevereException(Throwable, Throwable)
method version but you might still want to log the original cause as well.- Type Parameters:
T
- type- Parameters:
exception
- exception whose message should be logged. Must not benull
.logCause
- deterimnes whether initial cause of the exception should be logged as well- Returns:
- the same exception instance that was passed in as the
exception
parameter.
-
logSevereException
public <T extends Throwable> T logSevereException(T exception)
Same aslogSevereException(exception, true)
.- Type Parameters:
T
- type- Parameters:
exception
- exception whose message should be logged. Must not benull
.- Returns:
- the same exception instance that was passed in as the
exception
parameter.
-
logException
public <T extends Throwable> T logException(T exception, Throwable cause, Level level)
Method logsexception
's message at the logging level specified by thelevel
argument.If
cause
parameter is notnull
, it is logged as well andexception
original cause is initialized with instance referenced bycause
parameter.- Type Parameters:
T
- type- Parameters:
exception
- exception whose message should be logged. Must not benull
.cause
- initial cause of the exception that should be logged as well and set asexception
's original cause. May benull
.level
- loging level which should be used for logging- Returns:
- the same exception instance that was passed in as the
exception
parameter.
-
logException
public <T extends Throwable> T logException(T exception, boolean logCause, Level level)
Method logsexception
's message at the logging level specified by thelevel
argument.If
logCause
parameter istrue
,exception
's original cause is logged as well (if exists). This may be used in cases whenexception
's class provides constructor to initialize the original cause. In such case you do not need to uselogException(exception, cause, level)
method version but you might still want to log the original cause as well.- Type Parameters:
T
- type- Parameters:
exception
- exception whose message should be logged. Must not benull
.logCause
- deterimnes whether initial cause of the exception should be logged as welllevel
- loging level which should be used for logging- Returns:
- the same exception instance that was passed in as the
exception
parameter.
-
logException
public <T extends Throwable> T logException(T exception, Level level)
Same aslogException(exception, true, level)
.- Type Parameters:
T
- type- Parameters:
exception
- exception whose message should be logged. Must not benull
.level
- loging level which should be used for logging- Returns:
- the same exception instance that was passed in as the
exception
parameter.
-
-