com.sap.tc.logging

Class LogRecord

java.lang.Object
  extended bycom.sap.tc.logging.ExceptionHandling
      extended bycom.sap.tc.logging.LogRecord
All Implemented Interfaces:
ILogRecord, com.sap.tc.logging.ILogRecordFull, IRPRecord, Serializable

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

Internal form of log messages.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sap.tc.logging.ExceptionHandling
EX_NO_FILTER_EMSG, EX_NO_FORMATTER_EMSG, EX_NO_INSTANCE_EMSG
 
Constructor Summary
protected LogRecord(LogController source, String locName, int severity, String[] relatives, int msgType, Object msgCode, String resourceBundleName, String msgClear, Object[] args)
           
protected LogRecord(LogController source, String locName, int severity, String[] relatives, int msgType, Object msgCode, String resourceBundleName, String msgClear, Object[] args, Throwable msgExc)
           
protected LogRecord(LogController source, String locName, int severity, String[] relatives, int msgType, Object msgCode, String resourceBundleName, String msgClear, String[] args)
           
protected LogRecord(LogController source, String locName, Thread thr, int severity, LogController[] relatives, int msgType, Object msgCode, String resourceBundleName, String msgClear, Object[] args)
          Deprecated.  
protected LogRecord(LogController source, String locName, Thread thr, int severity, String[] relatives, int msgType, Object msgCode, String resourceBundleName, String msgClear, Object[] args)
           
protected LogRecord(LogController source, String locName, Thread thr, int severity, String[] relatives, int msgType, Object msgCode, String resourceBundleName, String msgClear, String[] args)
           
protected LogRecord(String msgId, Date time, String source, int severity, String loc, LogController[] relatives, String groupId, int level, int indent, String thr, int msgType, String msgCode, String resourceBundleName, String msgClear, String[] args, String application, String user, String session, String transaction)
           
protected LogRecord(String msgId, Date time, String source, int severity, String loc, String[] relatives, String groupId, int level, int indent, String thr, int msgType, String msgCode, String resourceBundleName, String msgClear, Object[] args, String application, String user, String session, String transaction, String dsrComponent, String dsrUser, String dsrTransaction)
           
protected LogRecord(String msgId, int size, Date time, String source, int severity, String loc, String[] relatives, String groupId, int level, int indent, String thr, int msgType, String msgCode, String resourceBundleName, String msgClear, Object[] args, String application, String user, String session, String transaction, String dsrComponent, String dsrUser, String dsrTransaction)
           
protected LogRecord(String msgId, int size, Date time, String source, int severity, String loc, String[] relatives, String groupId, int level, int indent, String thr, int msgType, String msgCode, String msgAlias, String resourceBundleName, String msgClear, Object[] args, String application, String user, String session, String transaction, String dsrComponent, String dsrUser, String dsrTransaction, Object msgAccessor)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getApplication()
          Gets the application on behalf of which this log record was issued.
 List getArgObjs()
          Gets the argument objects of the template-based message belonging to this log record.
 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.
 String getDsrComponent()
          Gets the DSR (Distributed Statistics Record) component on behalf of which this log record was issued.
 String getDsrTransaction()
          Gets the DSR (Distributed Statistics Record) transaction on behalf of which this log record was issued.
 String getDsrUser()
          Gets the DSR (Distributed Statistics Record) user on behalf of which this log record was issued.
 com.sap.tc.logging.Group getGroup()
          Deprecated. Not supported anymore
 String getGroupDescription()
          Gets the description of the group this log record belongs to.
 com.sap.tc.logging.GUId getGroupId()
          Gets the identification of the group.
 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.
 String getGroupName()
          Gets the name of the group this log record belongs to.
 List getGroups()
          Deprecated. Not supported anymore
 com.sap.tc.logging.GUId getId()
          Gets the message identification of this log record.
 int getIndent()
          Deprecated. @see #getGroupIndent()
 int getLevel()
          Deprecated. @see #getGroupLevel()
 String getLocation()
          Deprecated. @see #getLocationName()
 String getLocationName()
          Gets the name of the location the message belonging to this log record came from.
 String getLogName()
          Log name represents a Log where this LogRecord is written to.
 String getMessage()
          Gets the full message of this log record.
 String getMsgAlias()
          Gets the unique message alias.
 String getMsgClear()
          Gets the clear text version of this log record.
 String getMsgCode()
          Gets the toString result of the language-independent message code of this log record.
 String getMsgDefault()
          Gets the default text version of this log record.
 Throwable getMsgException()
          Gets the exception of this log record.
 String getMsgLocalized()
          Gets the localized text version of this log record.
 int getMsgType()
          Gets the type of the message text of this log record.
 Collection getRelatives()
          Gets the log controllers related to the source of this log record.
 String getResourceBundleName()
          Gets the name of the resource bundle assigned to the language-independent message belonging to this log record.
 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.
 String getSourceName()
          Gets the name of the log controller this log record came from.
 String getSysHostName()
           
 String getSysInstanceName()
           
 String getSysName()
           
 String getSysNodeID()
           
 Thread getThread()
          Gets the thread this log record belongs to if it still runs.
 String getThreadName()
          Gets the name of the thread this log record belongs to
 Date getTime()
          Gets the instantiation date of this log record in milliseconds.
 String getTransaction()
          Gets the application on behalf of which this log record was issued.
 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(String value)
           
 void setBookMark(long value)
           
 void setDsrComponent(String value)
           
 void setDsrTransaction(String value)
           
 void setDsrUser(String value)
           
 void setLogName(String value)
           
 void setSession(String value)
           
 void setSysHostName(String value)
           
 void setSysInstanceName(String value)
           
 void setSysName(String value)
           
 void setSysNodeID(String value)
           
 void setTransaction(String value)
           
 void setUser(String value)
           
 
Methods inherited from class com.sap.tc.logging.ExceptionHandling
getException, getExceptions, handleException, handleException, resetException, throwException
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogRecord

protected LogRecord(LogController source,
                    String locName,
                    int severity,
                    String[] relatives,
                    int msgType,
                    Object msgCode,
                    String resourceBundleName,
                    String msgClear,
                    String[] args)

LogRecord

protected LogRecord(LogController source,
                    String locName,
                    Thread thr,
                    int severity,
                    String[] relatives,
                    int msgType,
                    Object msgCode,
                    String resourceBundleName,
                    String msgClear,
                    String[] args)

LogRecord

protected LogRecord(String msgId,
                    int size,
                    Date time,
                    String source,
                    int severity,
                    String loc,
                    String[] relatives,
                    String groupId,
                    int level,
                    int indent,
                    String thr,
                    int msgType,
                    String msgCode,
                    String msgAlias,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args,
                    String application,
                    String user,
                    String session,
                    String transaction,
                    String dsrComponent,
                    String dsrUser,
                    String dsrTransaction,
                    Object msgAccessor)

LogRecord

protected LogRecord(String msgId,
                    int size,
                    Date time,
                    String source,
                    int severity,
                    String loc,
                    String[] relatives,
                    String groupId,
                    int level,
                    int indent,
                    String thr,
                    int msgType,
                    String msgCode,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args,
                    String application,
                    String user,
                    String session,
                    String transaction,
                    String dsrComponent,
                    String dsrUser,
                    String dsrTransaction)

LogRecord

protected LogRecord(String msgId,
                    Date time,
                    String source,
                    int severity,
                    String loc,
                    String[] relatives,
                    String groupId,
                    int level,
                    int indent,
                    String thr,
                    int msgType,
                    String msgCode,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args,
                    String application,
                    String user,
                    String session,
                    String transaction,
                    String dsrComponent,
                    String dsrUser,
                    String dsrTransaction)

LogRecord

protected LogRecord(LogController source,
                    String locName,
                    int severity,
                    String[] relatives,
                    int msgType,
                    Object msgCode,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args,
                    Throwable msgExc)

LogRecord

protected LogRecord(LogController source,
                    String locName,
                    int severity,
                    String[] relatives,
                    int msgType,
                    Object msgCode,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args)

LogRecord

protected LogRecord(LogController source,
                    String locName,
                    Thread thr,
                    int severity,
                    String[] relatives,
                    int msgType,
                    Object msgCode,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args)

LogRecord

protected LogRecord(String msgId,
                    Date time,
                    String source,
                    int severity,
                    String loc,
                    LogController[] relatives,
                    String groupId,
                    int level,
                    int indent,
                    String thr,
                    int msgType,
                    String msgCode,
                    String resourceBundleName,
                    String msgClear,
                    String[] args,
                    String application,
                    String user,
                    String session,
                    String transaction)

LogRecord

protected LogRecord(LogController source,
                    String locName,
                    Thread thr,
                    int severity,
                    LogController[] relatives,
                    int msgType,
                    Object msgCode,
                    String resourceBundleName,
                    String msgClear,
                    Object[] args)
Deprecated.  

Method Detail

getId

public com.sap.tc.logging.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 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 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(String value)
Specified by:
setApplication in interface IRPRecord

getUser

public 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(String value)
Specified by:
setUser in interface IRPRecord

getSession

public 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(String value)
Specified by:
setSession in interface IRPRecord

getTransaction

public 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(String value)
Specified by:
setTransaction in interface IRPRecord

getDsrComponent

public 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(String value)
Specified by:
setDsrComponent in interface IRPRecord

getDsrUser

public 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(String value)
Specified by:
setDsrUser in interface IRPRecord

getDsrTransaction

public 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(String value)
Specified by:
setDsrTransaction in interface IRPRecord

getSysHostName

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

setSysHostName

public void setSysHostName(String value)
Specified by:
setSysHostName in interface IRPRecord

getSysInstanceName

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

setSysInstanceName

public void setSysInstanceName(String value)
Specified by:
setSysInstanceName in interface IRPRecord

getSysName

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

setSysName

public void setSysName(String value)
Specified by:
setSysName in interface IRPRecord

getSysNodeID

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

setSysNodeID

public void setSysNodeID(String value)
Specified by:
setSysNodeID in interface IRPRecord

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 List getGroups()
Deprecated. Not supported anymore

Returns:
Collections.EMPTY_LIST

getGroup

public com.sap.tc.logging.Group getGroup()
Deprecated. Not supported anymore

Returns:
null

getGroupId

public com.sap.tc.logging.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 String getGroupID()
Gets the identification of the group this log record belongs to.

Returns:
Unique group id

getSourceName

public 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 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 String getGroupName()
Gets the name of the group this log record belongs to.

Returns:
Group name

getGroupDescription

public 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 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 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

getMsgAlias

public String getMsgAlias()
Gets the unique message alias.

Returns:
Unique message alias string.

getResourceBundleName

public 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 String getMessage()
Gets the full message of this log record.

Returns:
Full message (getMsgClear() + getArgs())

getMsgClear

public String getMsgClear()
Gets the clear text version of this log record.

Specified by:
getMsgClear in interface ILogRecord
Returns:
Clear text version

getMsgDefault

public String getMsgDefault()
Gets the default text version of this log record.

Returns:
Default text version

getMsgLocalized

public String getMsgLocalized()
Gets the localized text version of this log record.

Returns:
Localized text version

getMsgException

public Throwable getMsgException()
Gets the exception of this log record.

Returns:
Throwable object

getArgs

public 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 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 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(Object obj)

hashCode

public int hashCode()

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 String getLogName()
Log name represents a Log where this LogRecord is written to.

Returns:
Returns the Log Name.

setLogName

public void setLogName(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
Returns:
Log controller

getLocation

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


getLevel

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


getIndent

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


getThread

public 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
Returns:
Thread, or null if meanwhile the thread terminated


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.