public class CommonLogger extends Object implements StackLogger
| Modifier and Type | Field and Description |
|---|---|
static StackLogger |
legacyLogger |
static boolean |
useLegacyLogger |
TRACE_DEBUG, TRACE_ERROR, TRACE_EXCEPTION, TRACE_FATAL, TRACE_INFO, TRACE_MESSAGES, TRACE_NONE, TRACE_TRACE, TRACE_WARN| Constructor and Description |
|---|
CommonLogger(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
disableLogging()
Disable logging altogether.
|
void |
enableLogging()
Enable logging (globally).
|
int |
getLineCount()
Get the line count in the log stream.
|
static StackLogger |
getLogger(Class clazz) |
static StackLogger |
getLogger(String name) |
String |
getLoggerName()
The category for the logger.
|
static void |
init(Properties p) |
boolean |
isLoggingEnabled() |
boolean |
isLoggingEnabled(int logLevel)
Return true/false if loging is enabled at a given level.
|
void |
logDebug(String message)
Log a message into the log file.
|
void |
logError(String message)
Log an error message.
|
void |
logError(String message,
Exception ex)
Log an error message.
|
void |
logException(Throwable ex)
Log an exception.
|
void |
logFatalError(String message)
Log an error message.
|
void |
logInfo(String string)
Log an info message.
|
void |
logStackTrace()
log a stack trace.
|
void |
logStackTrace(int traceLevel)
Log a stack trace if the current logging level exceeds
given trace level.
|
void |
logTrace(String message)
Log a message into the log file.
|
void |
logWarning(String string)
Log a warning mesasge.
|
void |
setBuildTimeStamp(String buildTimeStamp)
Set the build time stamp.
|
void |
setStackProperties(Properties stackProperties)
Stack creation properties.
|
public static boolean useLegacyLogger
public static StackLogger legacyLogger
public CommonLogger(String name)
public static StackLogger getLogger(String name)
public static StackLogger getLogger(Class clazz)
public static void init(Properties p)
public void disableLogging()
StackLoggerdisableLogging in interface StackLoggerpublic void enableLogging()
StackLoggerenableLogging in interface StackLoggerpublic int getLineCount()
StackLoggergetLineCount in interface StackLoggerpublic String getLoggerName()
StackLoggergetLoggerName in interface StackLoggerpublic boolean isLoggingEnabled()
isLoggingEnabled in interface StackLoggerpublic boolean isLoggingEnabled(int logLevel)
StackLoggerisLoggingEnabled in interface StackLoggerpublic void logDebug(String message)
StackLoggerlogDebug in interface StackLoggermessage - message to log into the log file.public void logError(String message)
StackLoggerlogError in interface StackLoggermessage - --
error message to log.public void logError(String message, Exception ex)
StackLoggerlogError in interface StackLoggerpublic void logException(Throwable ex)
StackLoggerlogException in interface StackLoggerpublic void logFatalError(String message)
StackLoggerlogFatalError in interface StackLoggermessage - --
error message to log.public void logInfo(String string)
StackLoggerlogInfo in interface StackLoggerpublic void logStackTrace()
StackLoggerlogStackTrace in interface StackLoggerpublic void logStackTrace(int traceLevel)
StackLoggerlogStackTrace in interface StackLoggerpublic void logTrace(String message)
StackLoggerlogTrace in interface StackLoggermessage - message to log into the log file.public void logWarning(String string)
StackLoggerlogWarning in interface StackLoggerpublic void setBuildTimeStamp(String buildTimeStamp)
StackLoggersetBuildTimeStamp in interface StackLoggerpublic void setStackProperties(Properties stackProperties)
StackLoggersetStackProperties in interface StackLoggerCopyright © 2014. All Rights Reserved.