public class ImportLogWriter extends LogWriter
Overrides the base LogWriter
to provide logging to an
alternate log file for import functions.
All message keys retrieved by this class are automatically prefixed with "MSG.Import." when the message id is retrieved.
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
cvImportLog
A reference to the IMPORT log file.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
ImportLogWriter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getLogFileFolder()
Returns the configured file path for IMPORT log files.
|
static java.lang.String |
getLogFileName()
Returns the configured file name for IMPORT log files.
|
static org.apache.log4j.Level |
getLogLevel()
Returns the current log level for the IMPORT log.
|
static void |
log(java.lang.Exception e)
Writes a IMPORT log file entry for the given exception.
|
static void |
log(java.lang.String msgid)
Writes a IMPORT log file entry for the given message id.
|
static void |
log(java.lang.String msgid,
java.lang.Exception ex)
Writes a IMPORT 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 IMPORT log file entry for the given message id and exception.
|
static void |
log(java.lang.String msgid,
java.lang.String... values)
Writes a IMPORT log file entry for the given message id.
|
protected static void |
logMessage(org.apache.log4j.Level severity,
java.lang.String msgtext)
Writes a IMPORT 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 IMPORT log file entry for a separator (a series of dashes).
|
protected static java.lang.String |
qualifyMsgId(java.lang.String msgid)
Returns the given message id with "MSG.Import." prefixed to it.
|
static void |
setLogLevel(org.apache.log4j.Level severity)
Sets the current log level for the IMPORT log.
|
static void |
write(java.lang.String s)
Writes a IMPORT log file entry for the given string.
|
static void |
write(java.lang.String s,
org.apache.log4j.Level severity)
Writes a IMPORT 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 cvImportLog
public static void log(java.lang.String msgid)
msgid
- (String) The id for the message to log. The msgid is
automatically prefixed with "MSG.Import.".public static void log(java.lang.String msgid, java.lang.String... values)
msgid
- (String) The id for the message to log. The msgid is
automatically prefixed with "MSG.Import.".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. The msgid is
automatically prefixed with "MSG.Import.".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. The msgid is
automatically prefixed with "MSG.Import.".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).protected static java.lang.String qualifyMsgId(java.lang.String msgid)
msgid
- (String) The id for the message to qualify.