com.sap.tc.logging
Class LogRecord

java.lang.Object
  |
  +--com.sap.tc.logging.ExceptionHandling
        |
        +--com.sap.tc.logging.LogRecord
All Implemented Interfaces:
ILogRecord, com.sap.tc.logging.ILogRecordFull, IRPRecord, java.io.Serializable
Direct Known Subclasses:
PerfLogRecord

public class LogRecord
extends ExceptionHandling
implements java.io.Serializable, com.sap.tc.logging.ILogRecordFull

Internal form of log messages.

See Also:
Serialized Form

Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getApplication()
          Gets the application on behalf of which this log record was issued.
 java.util.List getArgObjs()
          Gets the argument objects of the template-based message belonging to this log record.
 java.util.List getArgs()
          Gets the toString results of the argument objects of the template-based message belonging to this log record.
 long getBookMark()
          BookMark represents a pointer in the Log where this LogRecord starts.
 java.lang.String getDsrComponent()
          Gets the DSR (Distributed Statistics Record) component on behalf of which this log record was issued.
 java.lang.String getDsrTransaction()
          Gets the DSR (Distributed Statistics Record) transaction on behalf of which this log record was issued.
 java.lang.String getDsrUser()
          Gets the DSR (Distributed Statistics Record) user on behalf of which this log record was issued.
 Group getGroup()
          Deprecated. Not supported anymore
 java.lang.String getGroupDescription()
          Gets the description of the group this log record belongs to.
 GUId getGroupId()
          Gets the identification of the group.
 java.lang.String getGroupID()
          Gets the identification of the group this log record belongs to.
 int getGroupIndent()
          Gets the indentation of nested groups of this log record.
 int getGroupLevel()
          Gets the level of nested groups this log record belongs to.
 java.lang.String getGroupName()
          Gets the name of the group this log record belongs to.
 java.util.List getGroups()
          Deprecated. Not supported anymore
 GUId getId()
          Gets the message identification of this log record.
 int getIndent()
          Deprecated. @see #getGroupIndent()
 int getLevel()
          Deprecated. @see #getGroupLevel()
 java.lang.String getLocation()
          Deprecated. @see #getLocationName()
 java.lang.String getLocationName()
          Gets the name of the location the message belonging to this log record came from.
 java.lang.String getLogName()
          Log name represents a Log where this LogRecord is written to.
 java.lang.String getMessage()
          Gets the full message of this log record.
 java.lang.String getMsgClear()
          Gets the clear text version of this log record.
 java.lang.String getMsgCode()
          Gets the toString result of the language-independent message code of this log record.
 java.lang.Throwable getMsgException()
          Gets the exception of this log record.
 int getMsgType()
          Gets the type of the message text of this log record.
 java.util.Collection getRelatives()
          Gets the log controllers related to the source of this log record.
 java.lang.String getResourceBundleName()
          Gets the name of the resource bundle assigned to the language-independent message belonging to this log record.
 java.lang.String getSession()
          Gets the session on behalf of which this log record was issued.
 int getSeverity()
          Gets the severity of this log record.
 int getSize()
          Gets size of this LogRecord.
 LogController getSource()
          Gets the log controller this log record came from.
 java.lang.String getSourceName()
          Gets the name of the log controller this log record came from.
 java.lang.String getSysHostName()
           
 java.lang.String getSysInstanceName()
           
 java.lang.String getSysName()
           
 java.lang.String getSysNodeID()
           
 java.lang.Thread getThread()
          Gets the thread this log record belongs to if it still runs.
 java.lang.String getThreadName()
          Gets the name of the thread this log record belongs to
 java.util.Date getTime()
          Gets the instantiation date of this log record in milliseconds.
 java.lang.String getTransaction()
          Gets the application on behalf of which this log record was issued.
 java.lang.String getUser()
          Gets the user on behalf of which this log record was issued.
 int hashCode()
           
 boolean isGroupActive()
          Gets the level of nested groups.
 void setApplication(java.lang.String value)
           
 void setBookMark(long value)
           
 void setDsrComponent(java.lang.String value)
           
 void setDsrTransaction(java.lang.String value)
           
 void setDsrUser(java.lang.String value)
           
 void setLogName(java.lang.String value)
           
 void setSession(java.lang.String value)
           
 void setSysHostName(java.lang.String value)
           
 void setSysInstanceName(java.lang.String value)
           
 void setSysName(java.lang.String value)
           
 void setSysNodeID(java.lang.String value)
           
 void setTransaction(java.lang.String value)
           
 void setUser(java.lang.String value)
           
 
Methods inherited from class com.sap.tc.logging.ExceptionHandling
getException, getExceptions, handleException, handleException, resetException, throwException
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getId

public GUId getId()
Gets the message identification of this log record. This identification is written to logs via most formatters and allows for unambiguous cross-referencing among messages in different logs.
Specified by:
getId in interface ILogRecord
Returns:
Unique message id

getSize

public int getSize()
Gets size of this LogRecord. The LogRecord size represent size of the LogRecord in the log file.
Returns:
Size in number of bytes.

getTime

public java.util.Date getTime()
Gets the instantiation date of this log record in milliseconds.
Specified by:
getTime in interface ILogRecord
Returns:
Instantiation date in milliseconds

getApplication

public java.lang.String getApplication()
Gets the application on behalf of which this log record was issued.
Specified by:
getApplication in interface IRPRecord
Returns:
Application

setApplication

public void setApplication(java.lang.String value)
Specified by:
setApplication in interface IRPRecord

getUser

public java.lang.String getUser()
Gets the user on behalf of which this log record was issued.
Specified by:
getUser in interface IRPRecord
Returns:
User

setUser

public void setUser(java.lang.String value)
Specified by:
setUser in interface IRPRecord

getSession

public java.lang.String getSession()
Gets the session on behalf of which this log record was issued.
Specified by:
getSession in interface IRPRecord
Returns:
Session

setSession

public void setSession(java.lang.String value)
Specified by:
setSession in interface IRPRecord

getTransaction

public java.lang.String getTransaction()
Gets the application on behalf of which this log record was issued.
Specified by:
getTransaction in interface IRPRecord
Returns:
Transaction

setTransaction

public void setTransaction(java.lang.String value)
Specified by:
setTransaction in interface IRPRecord

getDsrComponent

public java.lang.String getDsrComponent()
Gets the DSR (Distributed Statistics Record) component on behalf of which this log record was issued.
Specified by:
getDsrComponent in interface IRPRecord
Returns:
DSR component

setDsrComponent

public void setDsrComponent(java.lang.String value)
Specified by:
setDsrComponent in interface IRPRecord

getDsrUser

public java.lang.String getDsrUser()
Gets the DSR (Distributed Statistics Record) user on behalf of which this log record was issued.
Specified by:
getDsrUser in interface IRPRecord
Returns:
DSR user

setDsrUser

public void setDsrUser(java.lang.String value)
Specified by:
setDsrUser in interface IRPRecord

getDsrTransaction

public java.lang.String getDsrTransaction()
Gets the DSR (Distributed Statistics Record) transaction on behalf of which this log record was issued.
Specified by:
getDsrTransaction in interface IRPRecord
Returns:
DSR transaction

setDsrTransaction

public void setDsrTransaction(java.lang.String value)
Specified by:
setDsrTransaction in interface IRPRecord

getSysHostName

public java.lang.String getSysHostName()
Specified by:
getSysHostName in interface IRPRecord
Returns:
Returns the sysHostName.

setSysHostName

public void setSysHostName(java.lang.String value)
Specified by:
setSysHostName in interface IRPRecord
Parameters:
sysHostName - The sysHostName to set.

getSysInstanceName

public java.lang.String getSysInstanceName()
Specified by:
getSysInstanceName in interface IRPRecord
Returns:
Returns the sysInstanceName.

setSysInstanceName

public void setSysInstanceName(java.lang.String value)
Specified by:
setSysInstanceName in interface IRPRecord
Parameters:
sysInstanceName - The sysInstanceName to set.

getSysName

public java.lang.String getSysName()
Specified by:
getSysName in interface IRPRecord
Returns:
Returns the sysName.

setSysName

public void setSysName(java.lang.String value)
Specified by:
setSysName in interface IRPRecord
Parameters:
sysName - The sysName to set.

getSysNodeID

public java.lang.String getSysNodeID()
Specified by:
getSysNodeID in interface IRPRecord
Returns:
Returns the sysNodeID.

setSysNodeID

public void setSysNodeID(java.lang.String value)
Specified by:
setSysNodeID in interface IRPRecord
Parameters:
sysNodeID - The sysNodeID to set.

isGroupActive

public boolean isGroupActive()
Deprecated. Not supported anymore

Description copied from interface: ILogRecord
Gets the level of nested groups.
Specified by:
isGroupActive in interface ILogRecord
Returns:
 

getGroups

public java.util.List getGroups()
Deprecated. Not supported anymore

Returns:
Collections.EMPTY_LIST

getGroup

public Group getGroup()
Deprecated. Not supported anymore

Returns:
null

getGroupId

public GUId getGroupId()
Deprecated. Not supported anymore

Description copied from interface: ILogRecord
Gets the identification of the group.
Specified by:
getGroupId in interface ILogRecord
Returns:
null
See Also:
getGroupID()

getGroupID

public java.lang.String getGroupID()
Gets the identification of the group this log record belongs to.
Returns:
Unique group id

getSourceName

public java.lang.String getSourceName()
Gets the name of the log controller this log record came from.
Specified by:
getSourceName in interface ILogRecord
Returns:
Name of log controller

getLocationName

public java.lang.String getLocationName()
Gets the name of the location the message belonging to this log record came from.
Specified by:
getLocationName in interface ILogRecord
Returns:
Name of location

getGroupName

public java.lang.String getGroupName()
Gets the name of the group this log record belongs to.
Returns:
Group name

getGroupDescription

public java.lang.String getGroupDescription()
Gets the description of the group this log record belongs to.
Returns:
Description text

getGroupIndent

public int getGroupIndent()
Gets the indentation of nested groups of this log record. This is the level of this log record less the level of the log record emitted via this log controller and thread before.
Specified by:
getGroupIndent in interface ILogRecord
Returns:
Indentation of nested groups

getGroupLevel

public int getGroupLevel()
Gets the level of nested groups this log record belongs to. This is equivalent to getGroups().size().
Specified by:
getGroupLevel in interface ILogRecord
Returns:
Level of nested groups

getThreadName

public java.lang.String getThreadName()
Gets the name of the thread this log record belongs to
Specified by:
getThreadName in interface ILogRecord
Returns:
Name of the thread

getSeverity

public int getSeverity()
Gets the severity of this log record.
Specified by:
getSeverity in interface ILogRecord
Returns:
Severity

getMsgType

public int getMsgType()
Gets the type of the message text of this log record.
Specified by:
getMsgType in interface ILogRecord
Returns:
Type of message text

getMsgCode

public java.lang.String getMsgCode()
Gets the toString result of the language-independent message code of this log record.
Specified by:
getMsgCode in interface ILogRecord
Returns:
Code of language-independent message

getResourceBundleName

public java.lang.String getResourceBundleName()
Gets the name of the resource bundle assigned to the language-independent message belonging to this log record.
Specified by:
getResourceBundleName in interface ILogRecord
Returns:
Name of resource bundle

getMessage

public java.lang.String getMessage()
Gets the full message of this log record.
Returns:
Full message (getMsgClear() + getArgs())

getMsgClear

public java.lang.String getMsgClear()
Gets the clear text version of this log record.
Specified by:
getMsgClear in interface ILogRecord
Returns:
Clear text version

getMsgException

public java.lang.Throwable getMsgException()
Gets the exception of this log record.
Returns:
Throwable object

getArgs

public java.util.List getArgs()
Gets the toString results of the argument objects of the template-based message belonging to this log record.
Specified by:
getArgs in interface ILogRecord
Returns:
Unmodifiable list of message argument strings

getArgObjs

public java.util.List getArgObjs()
Gets the argument objects of the template-based message belonging to this log record.
Specified by:
getArgObjs in interface ILogRecord
Returns:
Unmodifiable list of argument objects

getRelatives

public java.util.Collection getRelatives()
Gets the log controllers related to the source of this log record.
Returns:
Unmodifiable collection of related log controllers

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setBookMark

public void setBookMark(long value)
Parameters:
value - The BookMark value to set.
See Also:
getBookMark()

getBookMark

public long getBookMark()
BookMark represents a pointer in the Log where this LogRecord starts.
Returns:
Returns the BookMark.

getLogName

public java.lang.String getLogName()
Log name represents a Log where this LogRecord is written to.
Returns:
Returns the Log Name.

setLogName

public void setLogName(java.lang.String value)
Parameters:
value - The Log name to set.
See Also:
getLogName()

getSource

public LogController getSource()
Deprecated. Not supported anymore - always return null

Description copied from interface: ILogRecord
Gets the log controller this log record came from.
Specified by:
getSource in interface ILogRecord
Following copied from interface: com.sap.tc.logging.interfaces.ILogRecord
Returns:
Log controller

getLocation

public java.lang.String getLocation()
Deprecated. @see #getLocationName()


getLevel

public int getLevel()
Deprecated. @see #getGroupLevel()


getIndent

public int getIndent()
Deprecated. @see #getGroupIndent()


getThread

public java.lang.Thread getThread()
Deprecated. Not supported anymore - always return null

Description copied from interface: ILogRecord
Gets the thread this log record belongs to if it still runs.
Specified by:
getThread in interface ILogRecord
Following copied from interface: com.sap.tc.logging.interfaces.ILogRecord
Returns:
Thread, or null if meanwhile the thread terminated