|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.safs.logging.LogItem org.safs.logging.FileLogItem org.safs.staf.service.logging.STAFFileLogItem org.safs.staf.service.logging.STAFXmlLogItem
public class STAFXmlLogItem
This class encapsulates a standard SAFS xml file log implemented using STAF. Log messages are written in a temporary STAF log while the log is running. Upon closing, the content of of the STAF log is formatted to the SAFS xml log standard and exported to the destination log file.
Note that logging function of this class is for local use only.
Field Summary | |
---|---|
protected boolean |
capXML
TRUE if the XML log should be capped at closure. |
Fields inherited from class org.safs.staf.service.logging.STAFFileLogItem |
---|
handle, LINEFEED, SAFSLOG_MAJOR_VER, SAFSLOG_MINOR_VER |
Fields inherited from class org.safs.logging.LogItem |
---|
closed, enabled, level, mode, name |
Constructor Summary | |
---|---|
STAFXmlLogItem(java.lang.String file)
Creates a disabled STAFXmlLogItem with default name (file
name) and log level (LOGLEVEL_INFO ), and empty parent
directory. |
|
STAFXmlLogItem(java.lang.String parent,
java.lang.String file)
Creates a disabled STAFXmlLogItem with default name (file
name) and log level (LOGLEVEL_INFO ). |
|
STAFXmlLogItem(java.lang.String name,
java.lang.String parent,
java.lang.String file)
Creates a disabled STAFXmlLogItem with default log level
(LOGLEVEL_INFO ). |
Method Summary | |
---|---|
protected void |
appendFinalLog(java.io.Writer out)
Override superclass prepend to provide a valid XML header if capXML is true. |
void |
close()
Close this log if enabled and open. |
boolean |
getCapXML()
Returns the current setting of whether the XML log will be capped on closure. |
void |
init()
Initializes this log and writes the log open message. |
void |
logMessage(java.lang.String msg)
Logs a message in standard SAFS text log format if enabled and open. |
void |
logMessage(java.lang.String msg,
int msgType)
Logs a message in standard SAFS text log format if enabled and open. |
void |
logMessage(java.lang.String msg,
java.lang.String desc,
int msgType)
Logs a message in standard SAFS xml log format if enabled and open. |
protected void |
prependFinalLog(java.io.Writer out)
Override superclass prepend to provide a valid XML header if capXML is true. |
void |
setCapXML(boolean capbool)
Set true if this log should be "capped" (made valid XML) upon closure. |
Methods inherited from class org.safs.staf.service.logging.STAFFileLogItem |
---|
exportSTAFLog, finalizeLogFile, readStringFromSTAFLog, readUIntFromSTAFLog, setHandle, stafLogLog, stafLogLog, stafLogRequest |
Methods inherited from class org.safs.logging.FileLogItem |
---|
fileExists, getAbsolutePath, getFileSpec, getParentDir, isFileSpecAbsolute, setParentDir |
Methods inherited from class org.safs.logging.LogItem |
---|
dateTime, isClosed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean capXML
Constructor Detail |
---|
public STAFXmlLogItem(java.lang.String name, java.lang.String parent, java.lang.String file)
STAFXmlLogItem
with default log level
(LOGLEVEL_INFO
).
The type of this log item is always LOGMODE_SAFS_XML
.
name
- the name of this log.parent
- the parent directory for this log.file
- the file spec of this log.public STAFXmlLogItem(java.lang.String parent, java.lang.String file)
STAFXmlLogItem
with default name (file
name) and log level (LOGLEVEL_INFO
).
The type of this log item is always LOGMODE_SAFS_XML
.
parent
- the parent directory for this log.file
- the file spec of this log.public STAFXmlLogItem(java.lang.String file)
STAFXmlLogItem
with default name (file
name) and log level (LOGLEVEL_INFO
), and empty parent
directory.
The type of this log item is always LOGMODE_SAFS_XML
.
file
- the file spec of this log.Method Detail |
---|
public void init()
init
in class STAFFileLogItem
public void setCapXML(boolean capbool)
capbool
- public boolean getCapXML()
public void logMessage(java.lang.String msg, java.lang.String desc, int msgType)
logMessage
in class LogItem
msg
- the message to log.desc
- additional description to log.msgType
- the int identifier of the type of message being logged.public void logMessage(java.lang.String msg, int msgType)
msg
- the message to log.msgType
- the int identifier of the type of message being logged.public void logMessage(java.lang.String msg)
Message type defaults to GENERIC_MESSAGE
.
msg
- the message to log.public void close() throws STAFLogException
close
in class STAFFileLogItem
STAFLogException
- if this method failed for any reason.protected void prependFinalLog(java.io.Writer out)
prependFinalLog
in class STAFFileLogItem
out
- PrintWriterprotected void appendFinalLog(java.io.Writer out)
appendFinalLog
in class STAFFileLogItem
out
- PrintWriter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |