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()
StackLogger
disableLogging
in interface StackLogger
public void enableLogging()
StackLogger
enableLogging
in interface StackLogger
public int getLineCount()
StackLogger
getLineCount
in interface StackLogger
public String getLoggerName()
StackLogger
getLoggerName
in interface StackLogger
public boolean isLoggingEnabled()
isLoggingEnabled
in interface StackLogger
public boolean isLoggingEnabled(int logLevel)
StackLogger
isLoggingEnabled
in interface StackLogger
public void logDebug(String message)
StackLogger
logDebug
in interface StackLogger
message
- message to log into the log file.public void logError(String message)
StackLogger
logError
in interface StackLogger
message
- --
error message to log.public void logError(String message, Exception ex)
StackLogger
logError
in interface StackLogger
public void logException(Throwable ex)
StackLogger
logException
in interface StackLogger
public void logFatalError(String message)
StackLogger
logFatalError
in interface StackLogger
message
- --
error message to log.public void logInfo(String string)
StackLogger
logInfo
in interface StackLogger
public void logStackTrace()
StackLogger
logStackTrace
in interface StackLogger
public void logStackTrace(int traceLevel)
StackLogger
logStackTrace
in interface StackLogger
public void logTrace(String message)
StackLogger
logTrace
in interface StackLogger
message
- message to log into the log file.public void logWarning(String string)
StackLogger
logWarning
in interface StackLogger
public void setBuildTimeStamp(String buildTimeStamp)
StackLogger
setBuildTimeStamp
in interface StackLogger
public void setStackProperties(Properties stackProperties)
StackLogger
setStackProperties
in interface StackLogger
Copyright © 2015. All Rights Reserved.