public class LoggingHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.logging.Level |
DEFAULT_TRACE_LOG_LEVEL
The default trace level that standard code trace points should use.
|
static java.util.logging.Level |
ENTRY_EXIT_LOG_LEVEL
The log level used for entry and exit trace.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
capitalize(java.lang.String str)
capitalize the first letter of a string
|
static java.util.logging.Logger |
getAdminLogger()
Returns the administrative logger associated with the default class.
|
static java.util.logging.Logger |
getAdminLogger(java.lang.Class loggedClass)
Returns the administrative logger associated with the specified class.
|
static java.util.logging.Logger |
getAdminLogger(java.lang.String loggedClassName)
Returns the administrative logger associated with the specified class
name.
|
static java.util.logging.Logger |
getLogger(java.lang.Class loggedClass)
Returns the logger associated with the specified class.
|
static java.util.logging.Logger |
getLogger(java.lang.String loggedClassName)
Returns the logger associated with the specified class name.
|
static java.util.logging.Logger |
getServiceLogger()
Returns the logger associated with the default service logger class.
|
static boolean |
isEntryExitTraceEnabled(java.util.logging.Logger logger)
Determines whether entry and exit tracing is enabled for the specified
logger.
|
static boolean |
isTraceEnabled(java.util.logging.Logger logger)
Returns whether the default trace is enabled for the specified logger.
|
static void |
logUnexpectedException(java.util.logging.Logger traceLogger,
java.lang.String className,
java.lang.String methodName,
java.lang.Throwable exception)
Log an unexpected exception in the system.
|
public static final java.util.logging.Level ENTRY_EXIT_LOG_LEVEL
public static final java.util.logging.Level DEFAULT_TRACE_LOG_LEVEL
public static java.util.logging.Logger getLogger(java.lang.Class loggedClass)
loggedClass
- The class for which the logger is being returned for.public static java.util.logging.Logger getLogger(java.lang.String loggedClassName)
loggedClassName
- The class name for which the logger is being returned for.public static java.util.logging.Logger getServiceLogger()
public static java.util.logging.Logger getAdminLogger()
public static java.util.logging.Logger getAdminLogger(java.lang.Class loggedClass)
loggedClass
- The class for which the logger is being returned for.public static java.util.logging.Logger getAdminLogger(java.lang.String loggedClassName)
loggedClassName
- The class name for which the logger is being returned for.public static boolean isEntryExitTraceEnabled(java.util.logging.Logger logger)
logger
- The logger used for tracing.public static boolean isTraceEnabled(java.util.logging.Logger logger)
logger
- The logger used for tracing.public static void logUnexpectedException(java.util.logging.Logger traceLogger, java.lang.String className, java.lang.String methodName, java.lang.Throwable exception)
traceLogger
- The logger.className
- The name of class in which the exception occurs.methodName
- The name of the method in which the exception occurs.exception
- The exception to be logged.public static java.lang.String capitalize(java.lang.String str)
str
- the string to capitalize