public final class LogUtils
extends java.lang.Object
AbstractDelegatingLogger, and advertise that class
via one of the following mechanisms:
setLoggerClass(Class) with a Class> reference to the logger class.Log4jLogger to use log4j instead of java.util.logging.| Modifier and Type | Method and Description |
|---|---|
protected static java.util.logging.Logger |
createLogger(java.lang.Class<?> cls,
java.lang.String name,
java.lang.String loggerName)
Create a logger
|
static java.util.logging.Logger |
getL7dLogger(java.lang.Class<?> cls)
Get a Logger with the associated default resource bundle for the class.
|
static java.util.logging.Logger |
getL7dLogger(java.lang.Class<?> cls,
java.lang.String resourcename)
Get a Logger with an associated resource bundle.
|
static java.util.logging.Logger |
getL7dLogger(java.lang.Class<?> cls,
java.lang.String resourcename,
java.lang.String loggerName)
Get a Logger with an associated resource bundle.
|
static java.util.logging.Logger |
getLogger(java.lang.Class<?> cls)
Get a Logger with the associated default resource bundle for the class.
|
static java.util.logging.Logger |
getLogger(java.lang.Class<?> cls,
java.lang.String resourcename)
Get a Logger with an associated resource bundle.
|
static java.util.logging.Logger |
getLogger(java.lang.Class<?> cls,
java.lang.String resourcename,
java.lang.String loggerName)
Get a Logger with an associated resource bundle.
|
static void |
log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message)
Checks log level and logs
|
static void |
log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Object parameter)
Checks log level and logs
|
static void |
log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Object[] parameters)
Checks log level and logs
|
static void |
log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable)
Checks log level and logs
|
static void |
log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable,
java.lang.Object... parameters)
Allows both parameter substitution and a typed Throwable to be logged.
|
static void |
log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable,
java.lang.Object parameter)
Allows both parameter substitution and a typed Throwable to be logged.
|
static void |
setLoggerClass(java.lang.Class<? extends AbstractDelegatingLogger> cls)
Specify a logger class that inherits from
AbstractDelegatingLogger. |
public static void setLoggerClass(java.lang.Class<? extends AbstractDelegatingLogger> cls)
AbstractDelegatingLogger.
Enable users to use their own logger implementation.public static java.util.logging.Logger getLogger(java.lang.Class<?> cls)
cls - the Class to contain the Loggerpublic static java.util.logging.Logger getLogger(java.lang.Class<?> cls,
java.lang.String resourcename)
cls - the Class to contain the Loggerresourcename - the resource namepublic static java.util.logging.Logger getLogger(java.lang.Class<?> cls,
java.lang.String resourcename,
java.lang.String loggerName)
cls - the Class to contain the Logger (to find resources)resourcename - the resource nameloggerName - the full name for the loggerpublic static java.util.logging.Logger getL7dLogger(java.lang.Class<?> cls)
cls - the Class to contain the Loggerpublic static java.util.logging.Logger getL7dLogger(java.lang.Class<?> cls,
java.lang.String resourcename)
cls - the Class to contain the Loggerresourcename - the resource namepublic static java.util.logging.Logger getL7dLogger(java.lang.Class<?> cls,
java.lang.String resourcename,
java.lang.String loggerName)
cls - the Class to contain the Logger (to find resources)resourcename - the resource nameloggerName - the full name for the loggerprotected static java.util.logging.Logger createLogger(java.lang.Class<?> cls,
java.lang.String name,
java.lang.String loggerName)
public static void log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable,
java.lang.Object parameter)
logger - the Logger the log tolevel - the severity levelmessage - the log messagethrowable - the Throwable to logparameter - the parameter to substitute into messagepublic static void log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable,
java.lang.Object... parameters)
logger - the Logger the log tolevel - the severity levelmessage - the log messagethrowable - the Throwable to logparameters - the parameters to substitute into messagepublic static void log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message)
logger - the Logger the log tolevel - the severity levelmessage - the log messagepublic static void log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Throwable throwable)
logger - the Logger the log tolevel - the severity levelmessage - the log messagethrowable - the Throwable to logpublic static void log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Object parameter)
logger - the Logger the log tolevel - the severity levelmessage - the log messageparameter - the parameter to substitute into messagepublic static void log(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String message,
java.lang.Object[] parameters)
logger - the Logger the log tolevel - the severity levelmessage - the log messageparameters - the parameters to substitute into message