- java.lang.Object
-
- com.sun.istack.logging.Logger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfig(String message)voidconfig(String message, Object[] params)voidconfig(String message, Throwable thrown)voidentering()voidentering(Object... parameters)voidexiting()voidexiting(Object result)voidfine(String message)voidfine(String message, Throwable thrown)voidfiner(String message)voidfiner(String message, Object[] params)voidfiner(String message, Throwable thrown)voidfinest(String message)voidfinest(String message, Object[] params)voidfinest(String message, Throwable thrown)static LoggergetLogger(Class<?> componentClass)The factory method returns preconfigured Logger wrapper for the class.static LoggergetLogger(String customLoggerName, Class<?> componentClass)The factory method returns preconfigured Logger wrapper for the class.voidinfo(String message)voidinfo(String message, Object[] params)voidinfo(String message, Throwable thrown)booleanisLoggable(Level level)booleanisMethodCallLoggable()voidlog(Level level, String message)voidlog(Level level, String message, Object param1)voidlog(Level level, String message, Object[] params)voidlog(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 thelevelargument.<T extends Throwable>
TlogException(T exception, Throwable cause, Level level)Method logsexception's message at the logging level specified by thelevelargument.<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 aSEVERElogging level message.<T extends Throwable>
TlogSevereException(T exception, Throwable cause)Method logsexception's message as aSEVERElogging level message.voidsetLevel(Level level)voidsevere(String message)voidsevere(String message, Object[] params)voidsevere(String message, Throwable thrown)voidwarning(String message)voidwarning(String message, Object[] params)voidwarning(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 aSEVERElogging level message.If
causeparameter is notnull, it is logged as well andexceptionoriginal cause is initialized with instance referenced bycauseparameter.- 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
exceptionparameter.
-
logSevereException
public <T extends Throwable> T logSevereException(T exception, boolean logCause)
Method logsexception's message as aSEVERElogging level message.If
logCauseparameter 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.- 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
exceptionparameter.
-
logSevereException
public <T extends Throwable> T logSevereException(T exception)
Same aslogSevereException(exception, true).
-
logException
public <T extends Throwable> T logException(T exception, Throwable cause, Level level)
Method logsexception's message at the logging level specified by thelevelargument.If
causeparameter is notnull, it is logged as well andexceptionoriginal cause is initialized with instance referenced bycauseparameter.- 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
exceptionparameter.
-
logException
public <T extends Throwable> T logException(T exception, boolean logCause, Level level)
Method logsexception's message at the logging level specified by thelevelargument.If
logCauseparameter 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.- 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
exceptionparameter.
-
logException
public <T extends Throwable> T logException(T exception, Level level)
Same aslogException(exception, true, level).
-
-