public class LogEvent extends java.lang.Object implements ILogEvent
Constructor and Description |
---|
LogEvent() |
LogEvent(java.lang.Exception e)
Constructs a message from a base exception.
|
LogEvent(java.lang.String msgFormat)
Constructs a message event
|
LogEvent(java.lang.String msgFormat,
java.lang.Exception exception)
Constructs a message from an exception.
|
LogEvent(java.lang.String msgFormat,
java.lang.Object[] params)
Constructs a message event with a list of parameters
that will be substituted into the message format.
|
LogEvent(java.lang.String msgFormat,
java.lang.String param)
Constructs a message with a parameter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEventType()
Retrieves log event type.
|
int |
getLevel()
Retrieves log level.
|
java.lang.String |
getMessage()
Returns the current message format string.
|
boolean |
getMultiline()
Retrieves log multiline attribute.
|
int |
getNTEventType()
Retrieves NT specific log event type.
|
java.lang.Object[] |
getParameters()
Returns a list of parameters.
|
LogSource |
getSource()
Retrieves log source.
|
long |
getTimeStamp()
Retrieves event time stamp.
|
void |
setEventType(java.lang.String eventType)
Sets log event type.
|
void |
setLevel(int level)
Sets log level, NT log event type.
|
void |
setMessage(java.lang.String message) |
void |
setMultiline(boolean multiline)
Sets log multiline attribute.
|
void |
setParameters(java.lang.Object[] params)
Sets audit event's parameters.
|
void |
setSource(LogSource source)
Sets log source.
|
java.lang.String |
toString()
Return string representation of log message.
|
public LogEvent()
public LogEvent(java.lang.String msgFormat)
msgFormat
- the message stringpublic LogEvent(java.lang.String msgFormat, java.lang.String param)
new AuditEvent("failed to load {0}", fileName);
msgFormat
- details in message string formatparam
- message string parameterpublic LogEvent(java.lang.String msgFormat, java.lang.Exception exception)
try { ... } catch (IOExeption e) { logHandler.log(new AuditEvent("Encountered System Error {0}", e); }
msgFormat
- exception details in message string formatexception
- system exceptionpublic LogEvent(java.lang.Exception e)
try { ... } catch (Exception e) { logHandler.log(new AuditEvent(e)); }
e
- CMS exceptionpublic LogEvent(java.lang.String msgFormat, java.lang.Object[] params)
msgFormat
- message string formatparams
- list of message format parameterspublic java.lang.String getMessage()
public void setMessage(java.lang.String message)
public java.lang.Object[] getParameters()
public void setParameters(java.lang.Object[] params)
public LogSource getSource()
public void setSource(LogSource source)
source
- the component source
where this message event was triggeredpublic int getLevel()
public int getNTEventType()
getNTEventType
in interface ILogEvent
public void setLevel(int level)
level
- Integer log level value.public boolean getMultiline()
getMultiline
in interface ILogEvent
public void setMultiline(boolean multiline)
multiline
- Boolean multiline value.public long getTimeStamp()
getTimeStamp
in interface ILogEvent
public java.lang.String getEventType()
getEventType
in interface ILogEvent
public void setEventType(java.lang.String eventType)
setEventType
in interface ILogEvent
eventType
- String containing the type of event.public java.lang.String toString()
toString
in class java.lang.Object