|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.tc.logging.ExceptionHandling
com.sap.tc.logging.Log
public abstract class Log
Writes log records to destinations. Writing log records is done on behalf of log controllers. On logging calls, records are written to the destination associated with the log in the format dictated by the formatter registered with the log, if the severity and the filters set for the log do not veto.
Please find fundamental information about the principles of error handling
in the package description. For this class, there are two cases where the
methods ExceptionHandling.getException() and ExceptionHandling.throwException() are served.
First, methods dealing with severities pass over a
java.lang.IllegalArgumentException if a value is out of range.
Second, output methods encountering problems leave the corresponding
java.io.IOException. Some of these problems are also logged
to the category /System/Logging which in turn writes messages
to the console.
LogController,
Severity,
Filter,
Formatter,
LogRecord| Field Summary | |
|---|---|
static int |
LOG_ACCESSABILITY_TYPE_LOCAL_LOG
Inheritance is allowed, but with additional condition: final discretion of message printing lies with the original parent object. |
static int |
LOG_ACCESSABILITY_TYPE_NORMAL_LOG
This type of Log allows regular inheritance; this log will become available to all descendants of the parent object. |
static int |
LOG_ACCESSABILITY_TYPE_PRIVATE_LOG
This type of Log completely disables inheritance. |
static int |
STATUS_CLOSED
|
static int |
STATUS_INVALID
|
static int |
STATUS_OPENED
|
| Fields inherited from class com.sap.tc.logging.ExceptionHandling |
|---|
EX_NO_FILTER_EMSG, EX_NO_FORMATTER_EMSG, EX_NO_INSTANCE_EMSG |
| Constructor Summary | |
|---|---|
protected |
Log()
|
protected |
Log(Formatter formatter)
|
| Method Summary | |
|---|---|
void |
addFilter(Filter filter)
Adds another filter that controls writing of messages via this log. |
protected void |
addOwner(String owner)
|
boolean |
beGroup()
Deprecated. Not supported anymore. Always return False! |
boolean |
beLogged(int severity)
Checks whether a message with the specified severity would be written via this log. |
protected Object |
clone()
|
void |
close()
Closes output of this log object. |
protected void |
closeInt()
Closes output of this log object. |
protected void |
finalize()
|
void |
flush()
Flushes buffered records in this log object. |
protected void |
flushInt()
Flushes buffered records in this log object. |
String |
getDescription()
Gets the description for this log. |
int |
getEffectiveSeverity()
Gets the current effective severity of this log. |
abstract String |
getEncoding()
Gets the canonical name of the character encoding that is used for this log. |
Collection |
getFilters()
Gets the filters that control writing of messages via this log. |
String |
getFooter()
Sets the footer text of this log. |
Formatter |
getFormatter()
Gets the formatter that dictates the format of log records in this log. |
String |
getHeader()
Gets the header text of this log. |
protected LogController |
getLocalLogOwner()
|
int |
getLoggedCount()
|
String |
getLogName()
Deprecated. @see {#getName()}. |
int |
getLogTypeAccessibility()
Gets the current accessibility type of this log. |
String |
getName()
Gets the name for this log. |
int |
getNumberOfLogRecordsWritten()
This method returns the number that indicates how many LogRecords have been written so far. |
List |
getOwners()
|
LogRecord |
getRecord()
Deprecated. - Not supported anymore - always return null |
String |
getVerInUse()
Gets the version of API. |
boolean |
isAutoFlush()
Checks whether this log flushes its output stream after each log message. |
boolean |
isClosed()
Check is this log closed. |
boolean |
isFiltersAgreeing(LogRecord rec)
Checks whether all filters associated with this log controller agree with writing a log record. |
protected boolean |
isHeaderWritten()
|
boolean |
isOpened()
Check is this log opened. |
boolean |
isSuppressing()
|
void |
open()
open output of this log object. |
protected void |
openInt()
Open output of this log object. |
void |
removeFilter(Filter filter)
Removes a filter so that it no longer controls writing of messages via this log. |
void |
removeFilters()
Removes all filters associated with this log. |
protected void |
removeOwner(String owner)
|
void |
reset()
Reset all current Log settings and starts from beginning Current file |
protected void |
resetInt()
Reset all current FileLog settings and starts from beginning Current file |
void |
resetLoggedCount()
|
void |
setAutoFlush(boolean autoFlush)
Configures this log to flush the output stream after each log message. |
void |
setDescription(String value)
Sets a description for this log. |
void |
setEffectiveSeverity(int severity)
Sets the effective severity of this log. |
abstract void |
setEncoding(String enc)
Sets the named character encoding to be used for this log. |
protected void |
setFooter(String value)
|
void |
setFormatter(Formatter formatter)
Sets the formatter that dictates the format of log records in this log. |
protected void |
setHeader(String value)
|
protected void |
setHeaderWritten(boolean headerWritten)
|
protected void |
setLocalLogOwner(LogController owner)
|
void |
setLogName(String name)
Deprecated. @see {#setName(String name)}. |
void |
setLogTypeAccessibility(int value)
Sets the accessibility level for this log. |
void |
setName(String name)
Sets a name for this log. |
protected void |
setSize(long value)
|
protected void |
setStatus(int status)
|
void |
setSuppressing(boolean suppressing)
|
protected void |
setVerInUse(String value)
|
long |
size()
Current size of the log. |
int |
status()
Status of this log object. |
LogRecord |
write(LogRecord rec)
Deprecated. not supported anymore |
protected String |
writeInt(LogRecord rec)
Writes a log record to this log. |
protected void |
writeInt(String s)
Writes a log message string to this log. |
protected void |
writeLogFooter()
Writes a log footer to this log. |
protected void |
writeLogHeader()
Writes a log header to this log. |
| Methods inherited from class com.sap.tc.logging.ExceptionHandling |
|---|
getException, getExceptions, handleException, handleException, resetException, throwException |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STATUS_INVALID
public static final int STATUS_CLOSED
public static final int STATUS_OPENED
public static final int LOG_ACCESSABILITY_TYPE_NORMAL_LOG
public static final int LOG_ACCESSABILITY_TYPE_LOCAL_LOG
public static final int LOG_ACCESSABILITY_TYPE_PRIVATE_LOG
| Constructor Detail |
|---|
protected Log()
protected Log(Formatter formatter)
| Method Detail |
|---|
protected void finalize()
throws Throwable
finalize in class ObjectThrowablepublic String getName()
getName in interface IObjectInfopublic void setName(String name)
public String getDescription()
getDescription in interface IObjectInfopublic void setDescription(String value)
public String getVerInUse()
getVerInUse in interface IObjectInfopublic int status()
status in interface ILogpublic String getHeader()
getHeader in interface ILogsetHeader(java.lang.String)public String getFooter()
getFooter in interface ILogsetHeader(java.lang.String)public int getEffectiveSeverity()
getEffectiveSeverity in interface ILogpublic void setEffectiveSeverity(int severity)
setEffectiveSeverity in interface ILogseverity - New effective severitypublic int getLogTypeAccessibility()
getLogTypeAccessibility in interface ILogLOG_ACCESSABILITY_TYPE_NORMAL_LOG
LOG_ACCESSABILITY_TYPE_LOCAL_LOG
LOG_ACCESSABILITY_TYPE_PRIVATE_LOG.public void setLogTypeAccessibility(int value)
setLogTypeAccessibility in interface ILognew - accessibility type
LOG_ACCESSABILITY_TYPE_NORMAL_LOG
LOG_ACCESSABILITY_TYPE_LOCAL_LOG
LOG_ACCESSABILITY_TYPE_PRIVATE_LOG.public Formatter getFormatter()
getFormatter in interface ILogsetFormatter(Formatter)public void setFormatter(Formatter formatter)
setFormatter in interface ILoggetFormatter()public int getNumberOfLogRecordsWritten()
getNumberOfLogRecordsWritten in interface ILogpublic long size()
public abstract String getEncoding()
getEncoding in interface ILogsetEncoding(java.lang.String)public abstract void setEncoding(String enc)
setEncoding in interface ILogenc - Name of character encodinggetEncoding()public boolean isFiltersAgreeing(LogRecord rec)
rec - Log record to be written
public Collection getFilters()
getFilters in interface ILogpublic void addFilter(Filter filter)
addFilter in interface ILogfilter - New filterpublic void removeFilter(Filter filter)
removeFilter in interface ILogfilter - Filter to be removedpublic void removeFilters()
removeFilters in interface ILogpublic boolean beLogged(int severity)
false the message is not going to be written
but not vice versa. To this end, the method checks whether the specified
severity is equal to or higher than the effective severity of the log. It
does not take into account filters associated with the log.
beLogged in interface ILogseverity - Severity of message to be writtenpublic LogRecord write(LogRecord rec)
rec - Record to be writtenpublic void flush()
flush in interface ILogpublic boolean isAutoFlush()
isAutoFlush in interface ILogtrue if and only if this log flushes its output stream
after each log messagesetAutoFlush(boolean)public void setAutoFlush(boolean autoFlush)
setAutoFlush in interface ILogautoFlush - isAutoFlush()public void open()
open in interface ILogpublic void close()
close in interface ILogpublic boolean isClosed()
isClosed in interface ILogpublic boolean isOpened()
isOpened in interface ILogpublic void reset()
public boolean isSuppressing()
public void setSuppressing(boolean suppressing)
public int getLoggedCount()
public void resetLoggedCount()
public List getOwners()
protected void setSize(long value)
protected void setStatus(int status)
protected void setHeader(String value)
protected void setFooter(String value)
protected void setVerInUse(String value)
protected Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
protected void writeInt(String s)
throws Exception
Writes a log message string to this log.
This method is meant as the standard way of implementing the fashion in
which a log message is written to its destination. Note that this method
is called inside a synchronized statement that locks this
log, in order to avoid deadlocks.
If you need access to the log record to be written you should override
writeInt(java.lang.String). Note that, nevertheless, even in
this case it is usually necessary to reimplement this method.
IOException - Exception from writing messages to the destination
Exception
protected void flushInt()
throws IOException
IOException - Exception from flushing records to the destination
protected void closeInt()
throws IOException
IOException - Exception from closing the destination
protected void openInt()
throws IOException
IOException - Exception from opening the destination
protected void resetInt()
throws Exception
Exception
protected String writeInt(LogRecord rec)
throws Exception
Writes a log record to this log.
This method is meant for overriding if you need access to the log record
to be written. You should not call this method from the outside because
you would ignore the checks for severities and filters done in
write(LogRecord). There are three basic use cases in which to
reimplement this method.
return super.writeInt(rec) as the last statement.
writeInt(java.lang.String) to write it. Finally, return
the string to the caller.
writeInt(String). Return null to
the caller.
synchronized
statement that locks this log, in order to avoid deadlocks.
If you want to override where to write a formatted string to, do not
override this method at all but instead reimplement
writeInt(String). Note that the first and second use case
usually also necessitate this reimplementation.
IOException - Exception from writing records to the destination
ExceptionwriteInt(java.lang.String)protected boolean isHeaderWritten()
protected void setHeaderWritten(boolean headerWritten)
protected void addOwner(String owner)
protected void removeOwner(String owner)
protected void setLocalLogOwner(LogController owner)
protected LogController getLocalLogOwner()
protected void writeLogHeader()
protected void writeLogFooter()
public LogRecord getRecord()
public boolean beGroup()
#LogController.beGroup()public String getLogName()
public void setLogName(String name)
| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] FRAMEWORK
|
[sap.com] tc/ddic/ddicruntime
|
[sap.com] ENGINEAPI
|
[sap.com] tc/logging
|
[sap.com] ENGFACADE
|
[sap.com] tc/bl/logging/api
|
[sap.com] CORE-TOOLS
|
[sap.com] com.sap.engine.client.lib
|
[sap.com] BRMS-FACADE
|
[sap.com] tc/brms/facade
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||