public class LogWriter extends Object implements StackLogger
| Modifier and Type | Field and Description |
|---|---|
protected int |
traceLevel
trace level
|
TRACE_DEBUG, TRACE_ERROR, TRACE_EXCEPTION, TRACE_FATAL, TRACE_INFO, TRACE_MESSAGES, TRACE_NONE, TRACE_TRACE, TRACE_WARN| Constructor and Description |
|---|
LogWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAppender(org.apache.log4j.Appender appender)
This method allows you to add an external appender.
|
void |
disableLogging()
Disable logging altogether.
|
void |
enableLogging()
Enable logging (globally).
|
org.apache.log4j.Level |
getLevel(int traceLevel) |
int |
getLineCount()
Get the line count in the log stream.
|
org.apache.log4j.Logger |
getLogger()
Get the logger.
|
String |
getLoggerName()
The category for the logger.
|
org.apache.log4j.Priority |
getLogPriority() |
int |
getTraceLevel()
Get the trace level for the stack.
|
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 configurationProperties)
Stack creation properties.
|
public void logStackTrace()
logStackTrace in interface StackLoggerpublic void logStackTrace(int traceLevel)
StackLoggerlogStackTrace in interface StackLoggerpublic int getLineCount()
getLineCount in interface StackLoggerpublic org.apache.log4j.Logger getLogger()
public void addAppender(org.apache.log4j.Appender appender)
appender - public void logException(Throwable ex)
logException in interface StackLoggerex - public void logDebug(String message)
logDebug in interface StackLoggermessage - message to log into the log file.public void logTrace(String message)
logTrace in interface StackLoggermessage - message to log into the log file.public int getTraceLevel()
public void logFatalError(String message)
logFatalError in interface StackLoggermessage - --
error message to log.public void logError(String message)
logError in interface StackLoggermessage - --
error message to log.public void setStackProperties(Properties configurationProperties)
StackLoggersetStackProperties in interface StackLoggerpublic boolean isLoggingEnabled()
isLoggingEnabled in interface StackLoggerpublic boolean isLoggingEnabled(int logLevel)
isLoggingEnabled in interface StackLoggerlogLevel - public void logError(String message, Exception ex)
logError in interface StackLoggermessage - ex - public void logWarning(String string)
logWarning in interface StackLoggerstring - public void logInfo(String string)
logInfo in interface StackLoggerstring - public void disableLogging()
disableLogging in interface StackLoggerpublic void enableLogging()
enableLogging in interface StackLoggerpublic void setBuildTimeStamp(String buildTimeStamp)
StackLoggersetBuildTimeStamp in interface StackLoggerpublic org.apache.log4j.Priority getLogPriority()
public org.apache.log4j.Level getLevel(int traceLevel)
public String getLoggerName()
StackLoggergetLoggerName in interface StackLoggerCopyright © 2014. All Rights Reserved.