com.digi.config.util
Class SystemLogEntry

java.lang.Object
  extended bycom.digi.config.core.ControlledItemImpl
      extended bycom.digi.config.util.SystemLogEntry
All Implemented Interfaces:
java.lang.Comparable, ControlledItem, java.io.Serializable

public class SystemLogEntry
extends ControlledItemImpl
implements ControlledItem

Defines an entry in the system log. Log entries are compound messages. At a minimum, they include a primary text message. They can optionally include a detail message a severity, and a service ID. Although it is possible for users to create SystemLogEntry's directly, typically users will use the static helper methods found in the SystemLog class. See the SystemLog class for details on how to do logging from a program. When SystemLogEntry objects are created users pass in a msg key. This key is used to look up the primary text from the message property file. The msg key is also used to look up the associated detail text, severity and service ID. The associated field keys are produced by appending the following tags to the primary msg key: _DETAILS - key to the second level detailed text message _SEVERITY - key to the message severity (see below for valid values) _ID - key to the message service id. The associated fields are optional, if they are not found in the message file, then they will default to empty or (in the case of severity ) to the value passed in on the constructor. Here is an example of a message stored in the Message file: MyMsg = My normal parameterized {0} message. MyMsg_DETAILS = My detailed parameterized {0} message that includes all the gory details \nand potential user actions. MyMsg_SEVERITY = 1 MyMsg_ID = common_023 The potential severity values are: 0 DEBUG 1 INFORMATION 2 WARNING 3 ERROR 4 FATAL Detail messages can be multi-line with the \n seperator char delineating lines. See the following classes for more information: SystemLog SystemLogEntry SystemLogCtlr

See Also:
Serialized Form

Nested Class Summary
 class SystemLogEntry.ExceptionInfo
          Contains localized and serializable information about an exception that occured
 
Field Summary
static int MSG_LEVEL_DEBUG
           
static int MSG_LEVEL_ERROR
           
static int MSG_LEVEL_FATAL
           
static int MSG_LEVEL_INFORMATION
           
static int MSG_LEVEL_WARNING
           
 
Fields inherited from class com.digi.config.core.ControlledItemImpl
 
Fields inherited from interface com.digi.config.core.ControlledItem
ALTERNATE_SORT_VALUE_KEY, BASE_SORT_VALUE_KEY
 
Constructor Summary
SystemLogEntry(java.lang.String msgId, java.io.Serializable[] msgParams, java.io.Serializable[] detailedMsgParams, int severity)
          Constructs a SystemLogEntry from a resource message and the specified message parameters.
SystemLogEntry(java.lang.String msgId, java.io.Serializable[] msgParams, java.io.Serializable[] detailedMsgParams, int severity, java.lang.Throwable t)
          Constructs a SystemLogEntry from a resource message and the specified message parameters.
 
Method Summary
 java.util.Calendar getCreationTime()
          Returns the time the log entry was created
 java.lang.String getDetailedMsg()
          Returns the localized 2nd level message text for this entry
 SystemLogEntry.ExceptionInfo getExceptionInfo()
          Returns any associated exception information
 java.lang.String getMsg()
          Returns the localized primary message text for this entry
 java.lang.String getServiceId()
          Returns the service ID associated with the log message
 int getSeverity()
          Returns the severity associated with this entry
 java.lang.String getSystemName()
          Returns the name of the system the log entry was created on
 boolean hasDetailedMsg()
          Indicates if there is a detailed messages within this entry
 java.lang.String toString()
          Return the SystemLogEntry text
 
Methods inherited from class com.digi.config.core.ControlledItemImpl
compareTo, dump, equals, getAlternateSortValue, getBaseSortValue, getId, getOwningCtlrId, hashCode, isActive, nullSafeCompare, setActive, setAlternateSortValue, setBaseSortValue, setOwningCtlrId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.digi.config.core.ControlledItem
compareTo, dump, equals, getAlternateSortValue, getBaseSortValue, getId, getOwningCtlrId, hashCode, isActive, setActive, setAlternateSortValue, setBaseSortValue, setOwningCtlrId
 

Field Detail

MSG_LEVEL_DEBUG

public static final int MSG_LEVEL_DEBUG
See Also:
Constant Field Values

MSG_LEVEL_INFORMATION

public static final int MSG_LEVEL_INFORMATION
See Also:
Constant Field Values

MSG_LEVEL_WARNING

public static final int MSG_LEVEL_WARNING
See Also:
Constant Field Values

MSG_LEVEL_ERROR

public static final int MSG_LEVEL_ERROR
See Also:
Constant Field Values

MSG_LEVEL_FATAL

public static final int MSG_LEVEL_FATAL
See Also:
Constant Field Values
Constructor Detail

SystemLogEntry

public SystemLogEntry(java.lang.String msgId,
                      java.io.Serializable[] msgParams,
                      java.io.Serializable[] detailedMsgParams,
                      int severity)
               throws java.util.MissingResourceException
Constructs a SystemLogEntry from a resource message and the specified message parameters. If the resource bundle contains the optional detailed message then that message will be created and attached to this entry. If the resource bundle contains the optional severity message then it will be extracted and will override an passed in severity for this entry.

Parameters:
msgId - The id of the message in the resource bundle
msgParams - The parameters of the message
detailedMsgParams - The parameters of the optional detailed message.
severity - The severity assigned to the entry

SystemLogEntry

public SystemLogEntry(java.lang.String msgId,
                      java.io.Serializable[] msgParams,
                      java.io.Serializable[] detailedMsgParams,
                      int severity,
                      java.lang.Throwable t)
               throws java.util.MissingResourceException
Constructs a SystemLogEntry from a resource message and the specified message parameters. If the resource bundle contains the optional detailed message then that message will be created and attached to this entry. If the resource bundle contains the optional severity message then it will be extracted and will override an passed in severity for this entry.

Parameters:
msgId - The id of the message in the resource bundle
msgParams - The parameters of the message
detailedMsgParams - The parameters of the optional detailed message.
severity - The severity assigned to the entry
t - the exception info to be attached to the log entry (may be null)
Method Detail

getMsg

public java.lang.String getMsg()
Returns the localized primary message text for this entry


getDetailedMsg

public java.lang.String getDetailedMsg()
Returns the localized 2nd level message text for this entry


getSeverity

public int getSeverity()
Returns the severity associated with this entry


hasDetailedMsg

public boolean hasDetailedMsg()
Indicates if there is a detailed messages within this entry


toString

public java.lang.String toString()
Return the SystemLogEntry text

Overrides:
toString in class ControlledItemImpl

getExceptionInfo

public SystemLogEntry.ExceptionInfo getExceptionInfo()
Returns any associated exception information


getCreationTime

public java.util.Calendar getCreationTime()
Returns the time the log entry was created


getSystemName

public java.lang.String getSystemName()
Returns the name of the system the log entry was created on


getServiceId

public java.lang.String getServiceId()
Returns the service ID associated with the log message



Copyright © 2001-2002 Digi International. All Rights Reserved.