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 StackLogger
public void logStackTrace(int traceLevel)
StackLogger
logStackTrace
in interface StackLogger
public int getLineCount()
getLineCount
in interface StackLogger
public org.apache.log4j.Logger getLogger()
public void addAppender(org.apache.log4j.Appender appender)
appender
- public void logException(Throwable ex)
logException
in interface StackLogger
ex
- public void logDebug(String message)
logDebug
in interface StackLogger
message
- message to log into the log file.public void logTrace(String message)
logTrace
in interface StackLogger
message
- message to log into the log file.public int getTraceLevel()
public void logFatalError(String message)
logFatalError
in interface StackLogger
message
- --
error message to log.public void logError(String message)
logError
in interface StackLogger
message
- --
error message to log.public void setStackProperties(Properties configurationProperties)
StackLogger
setStackProperties
in interface StackLogger
public boolean isLoggingEnabled()
isLoggingEnabled
in interface StackLogger
public boolean isLoggingEnabled(int logLevel)
isLoggingEnabled
in interface StackLogger
logLevel
- public void logError(String message, Exception ex)
logError
in interface StackLogger
message
- ex
- public void logWarning(String string)
logWarning
in interface StackLogger
string
- public void logInfo(String string)
logInfo
in interface StackLogger
string
- public void disableLogging()
disableLogging
in interface StackLogger
public void enableLogging()
enableLogging
in interface StackLogger
public void setBuildTimeStamp(String buildTimeStamp)
StackLogger
setBuildTimeStamp
in interface StackLogger
public org.apache.log4j.Priority getLogPriority()
public org.apache.log4j.Level getLevel(int traceLevel)
public String getLoggerName()
StackLogger
getLoggerName
in interface StackLogger
Copyright © 2015. All Rights Reserved.