public class Logfile
extends java.lang.Object
INFO, WARNING, ERROR and FATAL
The level of logging can be set to any of these severities. All Messages with a severity higher than the level of logging are written to the Logfile. There are two additional loglevels that can be set:
SILENT is used to suppress output of all Messages.
ALL is used to write all Messages (same as INFO).
All messages are prepended with the name of the current Thread which is
normally set to the testrun name in the importtool.
Modifier and Type | Field and Description |
---|---|
static byte |
ALL
Log all Messages regardless of their severity
|
static byte |
ERROR
Log only Messages with severity ERROR or FATAL
|
static byte |
FATAL
Log only Messages with severity FATAL
|
static byte |
INFO
Log all Messages with severity INFO, WARNING, ERROR or FATAL
|
static byte |
SILENT
Do not log any Messages
|
static byte |
TRACE
Log all Messages with severity TRACE, INFO, WARNING, ERROR or FATAL
|
static byte |
WARNING
Log only Messages with severity WARNING, ERROR or FATAL
|
Modifier and Type | Method and Description |
---|---|
static byte |
getCurrentLogLevel()
Get the current level of logging.
|
static java.lang.String |
getLogLevelString(byte level)
Get the String representation for a logging level.
|
static void |
initLogging(java.lang.String logFilePath,
java.lang.String message)
Initialize the Error Logging.
|
static void |
initLogging(java.lang.String logFilePath,
java.lang.String message,
java.lang.String logPref,
java.lang.String fatalPref)
Initialize the Error Logging.
|
static boolean |
isConsoleOutpt() |
static void |
putAlert(java.lang.String message)
Write a Message to the alert file.
|
static void |
putError(java.lang.String message)
Write an Error Message to the Logfile.
|
static void |
putException(java.lang.String message,
java.lang.String severity,
java.lang.Exception exception)
Write Information about an AoException to the Logfile.
|
static void |
putFatal(java.lang.String message)
Write a Fatal Error Message to the Logfile.
|
static void |
putInfo(java.lang.String message)
|
static void |
putTrace(java.lang.String message)
|
static void |
putWarning(java.lang.String message)
Write a Warning Message to the Logfile.
|
static void |
putWarningOnce(java.lang.String message)
Write a Warning Message to the Logfile only once.
|
static void |
setAlertFileName(java.lang.String path)
Set the path where the alert file will be created
|
static void |
setConsoleOutpt(boolean consoleOutpt) |
static void |
setLogLevel(byte level)
Set the current level of logging.
|
static void |
setLogLevelString(java.lang.String levelString)
Set the logging level using a String representation of the Enumeration.
|
public static final byte ALL
public static final byte TRACE
public static final byte INFO
public static final byte WARNING
public static final byte ERROR
public static final byte FATAL
public static final byte SILENT
public static void initLogging(java.lang.String logFilePath, java.lang.String message, java.lang.String logPref, java.lang.String fatalPref)
logFilePath
- The path where the logfile is created.message
- Initial Message to be writtenlogPref
- Logfile prefix (default is "importtool_");fatalPref
- Fatal file prefix (default is "importlog_");public static void initLogging(java.lang.String logFilePath, java.lang.String message)
logFilePath
- The path where the logfile is created.message
- Initial Message to be writtenpublic static void setLogLevel(byte level)
level
- The level of loggingpublic static void setAlertFileName(java.lang.String path)
path
- The path name. ("" means no alert file)public static byte getCurrentLogLevel()
public static java.lang.String getLogLevelString(byte level)
level
- The logging levelpublic static void setLogLevelString(java.lang.String levelString)
levelString
- The loglevel stringpublic static void putTrace(java.lang.String message)
INFO
, TRACE
or
ALL
message
- Message to be writtenpublic static void putInfo(java.lang.String message)
INFO
or ALL
message
- Message to be writtenpublic static void putException(java.lang.String message, java.lang.String severity, java.lang.Exception exception)
INFO
or ALL
severity
- Severity of the message ("I", "W", "E" of "F")exception
- The exception to be loggedmessage
- Message to be writtenpublic static void putWarning(java.lang.String message)
INFO
, WARNING
or ALL
.message
- Message to be writtenpublic static void putWarningOnce(java.lang.String message)
INFO
, WARNING
or
ALL
and it has not be written before. This is useful for warnings
regarding configuration errors.message
- Message to be writtenpublic static void putError(java.lang.String message)
INFO
, WARNING
, ERROR
or ALL
.message
- Message to be writtenpublic static void putAlert(java.lang.String message)
message
- Message to be writtenpublic static void putFatal(java.lang.String message)
SILENT
message
- Message to be writtenpublic static boolean isConsoleOutpt()
public static void setConsoleOutpt(boolean consoleOutpt)