public class AS400LogWriter extends LogWriter
Overrides the base LogWriter
to provide logging to an
alternate log file for AS400 functions.
All message keys retrieved by this class are assumed to be prefixed with "MSG.". Message keys supplied to this class' methods that are not already prefixed with "MSG." will be automatically prefixed when the key is retrieved.
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
cv400Log
A reference to the AS400 log file.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
AS400LogWriter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getLogFileFolder()
Returns the configured file path for AS400 log files.
|
static java.lang.String |
getLogFileName()
Returns the configured file name for AS400 log files.
|
static org.apache.log4j.Level |
getLogLevel()
Returns the current log level for the AS400 log.
|
static void |
log(java.lang.Exception e)
Writes a AS400 log file entry for the given exception.
|
static void |
log(java.lang.String msgid)
Writes a AS400 log file entry for the given message id.
|
static void |
log(java.lang.String msgid,
java.lang.Exception ex)
Writes a AS400 log file entry for the given message id and exception.
|
static void |
log(java.lang.String msgid,
java.lang.Exception ex,
java.lang.String... values)
Writes a AS400 log file entry for the given message id and exception.
|
static void |
log(java.lang.String msgid,
java.lang.String... values)
Writes a AS400 log file entry for the given message id.
|
protected static void |
logMessage(org.apache.log4j.Level severity,
java.lang.String msgtext)
Writes a AS400 log file entry for the given severity level and message text
and sends an email if the message severity is configured for alert emails.
|
static void |
logSeparator()
Writes a AS400 log file entry for a separator (a series of dashes).
|
static void |
setLogLevel(org.apache.log4j.Level severity)
Sets the current log level for the AS400 log.
|
static void |
write(java.lang.String s)
Writes a AS400 log file entry for the given string.
|
static void |
write(java.lang.String s,
org.apache.log4j.Level severity)
Writes a AS400 log file entry for the given string and severity level.
|
dumpPropertiesToFile, dumpPropertiesToList, getAlertLevel, getStackTrace, log, parseMessage, parseMessage, sendAlertEmail, setAlertLevel
private static final long serialVersionUID
private static org.apache.log4j.Logger cv400Log
public static void log(java.lang.String msgid)
msgid
- (String) The id for the message to log. If necessary,
the msgid is automatically prefixed with "MSG.".public static void log(java.lang.String msgid, java.lang.String... values)
msgid
- (String) The id for the message to log. If necessary,
the msgid is automatically prefixed with "MSG.".values
- (String) The value(s) to replace in the message text.
This parameter uses the varargs feature and can therefore be
passed as multiple parms (msgid, value1, value2, value3, valueN)
or as an array (msgid, values[]).public static void log(java.lang.String msgid, java.lang.Exception ex)
msgid
- (String) The id for the message to log. If necessary,
the msgid is automatically prefixed with "MSG.".ex
- (Exception) The exception to log.public static void log(java.lang.String msgid, java.lang.Exception ex, java.lang.String... values)
msgid
- (String) The id for the message to log. If necessary,
the msgid is automatically prefixed with "MSG.".ex
- (Exception) The exception to log.values
- (String) The value(s) to replace in the message text.
This parameter uses the varargs feature and can therefore be
passed as multiple parms (msgid, value1, value2, value3, valueN)
or as an array (msgid, values[]).public static void log(java.lang.Exception e)
e
- (Exception) The exception to log.protected static void logMessage(org.apache.log4j.Level severity, java.lang.String msgtext)
logMessage
in the shared LogWriter.severity
- (Level) The severity of the message. Must be one of
the defined constants (DEBUG, INFO, WARN, ERROR or FATAL).msgtext
- (String) The text for the message to log and email.public static void logSeparator()
public static java.lang.String getLogFileFolder()
public static java.lang.String getLogFileName()
public static org.apache.log4j.Level getLogLevel()
public static void setLogLevel(org.apache.log4j.Level severity)
severity
- (Level) The current log level. Must be one of the
defined constants (DEBUG, INFO, WARN, ERROR or FATAL) or OFF.public static void write(java.lang.String s)
s
- (String) The string to write.public static void write(java.lang.String s, org.apache.log4j.Level severity)
s
- (String) The string to write.severity
- (Level) The severity of the message. Must be one of
the defined constants (DEBUG, INFO, WARN, ERROR or FATAL).