|
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.LogController
public abstract class LogController
Controls output to logs, which stand for destinations to write log messages
to.
Log controllers are the objects you call to write messages. To this end,
log controllers provide you with methods for associating logs with them and
for controlling the actual writing of messages. In practive, however, you
deal with concrete subclasses of this abstract class, such as
Location for trace messages or Category for log messages.
As the signatures of the methods to emit messages depend on these concrete
classes, we have furnished them rather than log controllers with these
methods, so there are no abstract output methods.
When you call an output method, the actual writing of the message to a log
depends on the severities of the message at hand, the log
controller and the logs attached to it, as well as optional
filters associated with the latter two. Typical severities are
error and warning, and you can find constants for all
the possible severities in the class Severity. Messages which
have at least the effective severity of the controller are
candidates for output and are forwarded to the logs attached to
the controller with the method addLog(Log). Beforehand, however,
filters get the chance to veto the decision on basis of the internal
message representation, the LogRecord.
Log controllers are automatically ordered into hierarchies. Hierarchies of
controllers are built up according to the hierarchical naming schemes of
the concrete subclasses of LogController. A child log
controller inherits some properties from its parent, for example its
severity and its logs. The effective severity of a child log controller is
calculated from its minimum and maximum severities, as
well as the effective severity of its parent. Most of the time you will
have no need for these two severities. Instead you will either use the
setting inherited from the parent controller or override the parent setting
with an explicit effective value for the child. To do the latter, call the
method setEffectiveSeverity(int) with the effective value you
would like to have logged.
Time and again, however, you will want to use a more elaborate scheme to
control severities, and have different minimum and maximum severities set
with calls to setMinimumSeverity(int) and
setMaximumSeverity(int), respectively. With the minimum severity
you specify the severity that messages must have at the least to be output
via the child log controller. That is, if the effective severity of the
parent log controller is higher than the minimum severity of the child than
the latter inherits the parent's effective severity, otherwise it is set to
the minimum severity. On the other hand, you specify the severity that
messages must have for output to be guaranteed, save intervention from
filters, using the maximum severity. That is, if the effective severity of
the parent log controller is lower than the maximum severity of the child
than the latter inherits the parent's effective severity, otherwise it is
set to the maximum severity. This implies that if both minimum and maximum
severity are set to the same value the effective severity gets that value
regardless of the effective severity of the parent. Such a setting is
therefore called dominant. For root log controllers the setting
must be dominant, as separate minimum and maximum values are meaningless
without a parent to inherit from.
Please find fundamental information about the principles of error handling
in the package description. In the case of this class, if a value is out of
range for one of the calls dealing with severities, the methods
ExceptionHandling.getException() and ExceptionHandling.throwException() are served with a
java.lang.IllegalArgumentException.
Log,
LogRecord,
Severity,
Filter| Field Summary | |
|---|---|
static int |
INHERITED_SEVERITY
|
static int |
RUN_TIME_SEVERITY
|
static int |
SEVERITY_FROM_CONFIGURATION
|
static int |
SEVERITY_FROM_DC
|
protected static boolean |
severityFromDC
|
| Fields inherited from class com.sap.tc.logging.ExceptionHandling |
|---|
EX_NO_FILTER_EMSG, EX_NO_FORMATTER_EMSG, EX_NO_INSTANCE_EMSG |
| Method Summary | |
|---|---|
void |
addFilter(Filter filter)
Adds another filter that, besides the effective severity, controls output via this log controller. |
void |
addLocalLog(Log log)
Deprecated. |
void |
addLog(Log log)
Adds another log for this log controller to write messages to. |
void |
addPrivateLog(Log log)
Adds another private log for this log controller to write messages to. |
boolean |
beDebug()
Same as beLogged(int)
but always checks for a debug message, that is a message with severity
Severity.DEBUG. |
boolean |
beDebug(LogController relative)
Deprecated. |
boolean |
beDebug(LogController[] relatives)
Deprecated. |
boolean |
beError()
Same as beLogged(int)
but always checks for an error message, that is a message with severity
Severity.ERROR. |
boolean |
beError(LogController relative)
Deprecated. |
boolean |
beError(LogController[] relatives)
Deprecated. |
boolean |
beFatal()
Same as beLogged(int)
but always checks for a fatal error message, that is a message with
severity
Severity.FATAL. |
boolean |
beFatal(LogController relative)
Deprecated. |
boolean |
beFatal(LogController[] relatives)
Deprecated. |
boolean |
beGroup()
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
boolean |
beInfo()
Same as beLogged(int)
but always checks for an informational message, that is a message with
severity
Severity.INFO. |
boolean |
beInfo(LogController relative)
Deprecated. |
boolean |
beInfo(LogController[] relatives)
Deprecated. |
boolean |
beLogged(int severity)
Checks whether a message with the specified severity would be written via this log controller. |
boolean |
beLogged(int severity,
LogController relative)
Deprecated. |
boolean |
beLogged(int severity,
LogController[] relatives)
Deprecated. |
boolean |
bePath()
Same as beLogged(int)
but always checks for a path message, that is a message with severity
Severity.PATH. |
boolean |
bePath(LogController relative)
Deprecated. |
boolean |
bePath(LogController[] relatives)
Deprecated. |
boolean |
beWarning()
Same as beLogged(int)
but always checks for a warning message, that is a message with severity
Severity.WARNING. |
boolean |
beWarning(LogController relative)
Deprecated. |
boolean |
beWarning(LogController[] relatives)
Deprecated. |
protected LogRecord |
catchingIntByAPI(Throwable exc)
|
void |
closeGroup()
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
protected String[] |
convertRelatives(LogController[] relatives)
|
Collection<Log> |
getAllLogs()
Gets all logs (public, private, local and logs inherent from parent) this log controller writes messages to. |
Collection<LogController> |
getChildren()
Gets the collection of children of this log controller. |
ClassLoader |
getClassLoader()
Gets the class loader assigned to this log controller for getting resource bundles. |
static long |
getDebugCounter()
|
String |
getDescription()
Gets the description for this log. |
int |
getEffectiveSeverity()
Gets the current effective severity of this log controller. |
int |
getEffectiveSeverity(LogController relative)
Deprecated. |
int |
getEffectiveSeverity(LogController[] relatives)
Deprecated. |
static long |
getErrorCounter()
|
static long |
getFatalCounter()
|
Collection |
getFilters()
Gets the filters that, besides the effective severity, control output via this log controller. |
int |
getGroupSize()
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
static long |
getInfoCounter()
|
boolean |
getIsActivityTrackingEnabled()
|
Collection<Log> |
getLocalLogs()
Deprecated. |
protected Map |
getLocalLogsMap()
|
int |
getLoggedCnt()
|
int |
getLoggedCount()
|
Collection<Log> |
getLogs()
Gets the normal logs this log controller writes messages to. |
int |
getMaximumSeverity()
Deprecated. |
int |
getMaximumSeverity(LogController relative)
Deprecated. |
int |
getMaximumSeverity(LogController[] relatives)
Deprecated. |
int |
getMinimumSeverity()
Deprecated. |
int |
getMinimumSeverity(LogController relative)
Deprecated. |
int |
getMinimumSeverity(LogController[] relatives)
Deprecated. |
String |
getName()
Gets the name for this log. |
int |
getOriginOfSeverity()
|
static long |
getPathCounter()
|
Collection<Log> |
getPrivateLogs()
Gets the private logs this log controller writes messages to. |
LogController[] |
getRelatives()
Deprecated. |
String |
getResourceBundleName()
Gets the name of the optional resource bundle assigned to this log controller. |
int |
getSavedSeverity()
|
static long |
getTotalLogsCount()
|
String |
getVerInUse()
Gets the version of API. |
static long |
getWarningCounter()
|
LogRecord |
group(Object msgCode)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(Object msgCode,
Object[] args)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(Object msgCode,
Object[] args,
String msgClear)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(Object msgCode,
String msgClear)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(String subloc,
Object msgCode)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(String subloc,
Object msgCode,
Object[] args)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(String subloc,
Object msgCode,
Object[] args,
String msgClear)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
group(String subloc,
Object msgCode,
String msgClear)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
groupT(String msg)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
groupT(String msg,
Object[] args)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
groupT(String subloc,
String msg)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
LogRecord |
groupT(String subloc,
String msg,
Object[] args)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
boolean |
isActivityTracking(int severity)
|
boolean |
isConfigurationChanged()
Check whether configuration on this LogController was changed! |
boolean |
isCopyToSubtree()
|
boolean |
isFiltersAgreeing(LogRecord rec)
Checks whether all filters associated with this log controller agree with writing a log record. |
boolean |
isInheritFromParent()
|
protected LogRecord |
logIntByAPI(int severity,
Location loc,
String subloc,
String msgCode,
String msgClear,
Object[] args)
|
protected LogRecord |
logIntByAPI(int severity,
Location loc,
String subloc,
String msgCode,
String msgClear,
Object[] args,
Throwable exc)
|
protected LogRecord |
messageInt(LogRecord rec)
Deprecated. Use messageInternal() |
protected LogRecord |
messageInternal(LogRecord rec)
|
void |
release()
Drops all internal references to this log controller and its children. |
void |
removeFilter(Filter filter)
Removes a filter, so that it no longer controls output via this log controller. |
void |
removeFilters()
Removes all filters associated with this log controller. |
void |
removeLog(Log log)
Removes a log associated with this log controller. |
void |
removeLogs()
Removes all logs associated with this log controller. |
static String |
replaceArguments(String message,
Object[] args)
|
static String |
replaceException(LogRecord rec,
String msg)
|
void |
reset()
Reset this LogController to the initail state. |
void |
resetAll()
Reset this LogController and his children to the initail state |
void |
resetLoggedCount()
|
static void |
resetSeverityCounters()
|
static void |
setActivityTracking(com.sap.tc.logging.interfaces.ISATChecker value)
|
void |
setClassLoader()
Resets the class loader assigned to this log controller for getting resource bundles. |
void |
setClassLoader(ClassLoader classLoader)
Assigns a class loader to this log controller for getting resource bundles. |
void |
setCopyToSubtree(boolean copyToSubtree)
|
void |
setDescription(String value)
Sets a description for this log. |
void |
setEffectiveSeverity()
Resets the effective severity of this log controller. |
void |
setEffectiveSeverity(int severity)
|
void |
setEffectiveSeverity(int severity,
boolean copyToSubtree)
Sets the effective severity of this log controller. |
void |
setEffectiveSeverity(int severity,
boolean copyToSubtree,
int originSeverity)
|
void |
setGroupSize(int size)
Deprecated. Groups are not used and implementation was removed for memory usage improvement, Instead use correlation id. |
void |
setMaximumSeverity()
Deprecated. |
void |
setMaximumSeverity(int severity)
Deprecated. |
void |
setMinimumSeverity()
Deprecated. |
void |
setMinimumSeverity(int severity)
Deprecated. |
void |
setName(String name)
Sets a name for this log. |
protected void |
setOriginOfSeverity(int originSeverity)
|
void |
setResourceBundleName()
Resets the resource bundle name of this log controller. |
void |
setResourceBundleName(String resourceBundleName)
Assigns a resource bundle name to this log controller. |
static void |
setSeverityFromDC(Properties dcSeverity)
|
protected int |
typeOfMessage(Object[] args)
|
| Methods inherited from class com.sap.tc.logging.ExceptionHandling |
|---|
getException, getExceptions, handleException, handleException, resetException, throwException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INHERITED_SEVERITY
public static final int SEVERITY_FROM_CONFIGURATION
public static final int RUN_TIME_SEVERITY
public static final int SEVERITY_FROM_DC
protected static boolean severityFromDC
| Method Detail |
|---|
public boolean isConfigurationChanged()
public void release()
public void reset()
public void resetAll()
public 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 Collection<LogController> getChildren()
public void closeGroup()
public int getGroupSize()
public void setGroupSize(int size)
public int getOriginOfSeverity()
protected void setOriginOfSeverity(int originSeverity)
public void setEffectiveSeverity(int severity,
boolean copyToSubtree,
int originSeverity)
public LogRecord groupT(String msg)
public LogRecord groupT(String subloc,
String msg)
public LogRecord groupT(String msg,
Object[] args)
public LogRecord groupT(String subloc,
String msg,
Object[] args)
public LogRecord group(Object msgCode)
public LogRecord group(String subloc,
Object msgCode)
public LogRecord group(Object msgCode,
Object[] args)
public LogRecord group(String subloc,
Object msgCode,
Object[] args)
public LogRecord group(Object msgCode,
String msgClear)
public LogRecord group(String subloc,
Object msgCode,
String msgClear)
public LogRecord group(Object msgCode,
Object[] args,
String msgClear)
public LogRecord group(String subloc,
Object msgCode,
Object[] args,
String msgClear)
public int getMinimumSeverity()
Severity.ALL.public int getMinimumSeverity(LogController relative)
relative - Related log controller
Severity.ALL.public int getMinimumSeverity(LogController[] relatives)
getMinimumSeverity(LogController) but returns the minimum
of the values of the specified log controllers. This is the value that is
effective for a message directed to all of them at the same time, for
example a message belonging to several categories.
relatives - Related log controllers
Severity.ALL.public int getEffectiveSeverity()
Severity.NONE.public int getEffectiveSeverity(LogController relative)
relative - Related log controller
Severity.NONE.public int getEffectiveSeverity(LogController[] relatives)
getEffectiveSeverity(LogController) but returns the
minimum of the values of the specified log controllers. This is the value
that is effective for a message directed to all of them at the same time,
for example a message belonging to several categories.
relatives - Related log controllers
Severity.NONE.public int getMaximumSeverity()
Severity.NONE.public int getMaximumSeverity(LogController relative)
relative - Related log controller
Severity.NONE.public int getMaximumSeverity(LogController[] relatives)
getMaximumSeverity(LogController) but returns the minimum
of the values of the specified log controllers. This is the value that is
effective for a message directed to all of them at the same time, for
example a message belonging to several categories.
relatives - Related log controllers
Severity.NONE.public void setMinimumSeverity(int severity)
setEffectiveSeverity(int).
severity - New minimum severitypublic void setMinimumSeverity()
setMinimumSeverity(int) with
Severity.ALL.
public void setEffectiveSeverity(int severity)
public void setEffectiveSeverity(int severity,
boolean copyToSubtree)
setMinimumSeverity(int) and
setMaximumSeverity(int).
severity - New effective severitypublic void setEffectiveSeverity()
setMinimumSeverity() and
setMaximumSeverity().
public void setMaximumSeverity(int severity)
setEffectiveSeverity(int).
severity - New maximum severitypublic void setMaximumSeverity()
setMinimumSeverity(int) with
Severity.NONE.
public int getSavedSeverity()
public static void setSeverityFromDC(Properties dcSeverity)
public Collection<Log> getLogs()
public Collection<Log> getLocalLogs()
public Collection<Log> getPrivateLogs()
public Collection<Log> getAllLogs()
public void addLog(Log log)
log - New log objectpublic void addLocalLog(Log log)
log - New log objectpublic void addPrivateLog(Log log)
log - New log objectpublic void removeLog(Log log)
log - Log to be removedpublic void removeLogs()
public boolean isFiltersAgreeing(LogRecord rec)
rec - Log record to be checked
public Collection getFilters()
public void addFilter(Filter filter)
filter - New filterpublic void removeFilter(Filter filter)
filter - Filter to be removedpublic void removeFilters()
public LogController[] getRelatives()
public String getResourceBundleName()
nullsetResourceBundleName(java.lang.String)public void setResourceBundleName(String resourceBundleName)
resourceBundle - Name of resource bundlegetResourceBundleName()public void setResourceBundleName()
getResourceBundleName()public ClassLoader getClassLoader()
setClassLoader(java.lang.ClassLoader)public void setClassLoader(ClassLoader classLoader)
classLoader - Class loadergetClassLoader()public void setClassLoader()
getClassLoader()public 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
controller. It does neither take into account severities assigned to
relations with other log controllers nor filters associated with the log
controller or logs. This version of the method is more efficient than the
version also taking another log controller as argument, and therefore
better fits the purpose to avoid inefficiencies.
severity - Severity of message to be writtenbeLogged(int,
LogController),
beLogged(int,
LogController[])
public boolean beLogged(int severity,
LogController relative)
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
controller or a severity assigned to the relation of this controller to
the one handed over as argument. It does not take into account filters
associated with the log controller or logs. This version of the method is
less efficient than the version with one argument, and therefore does not
fit the purpose to avoid inefficiencies as well.
severity - Severity of message to be writtenrelative - Related log controllerbeLogged(int)
public boolean beLogged(int severity,
LogController[] relatives)
beLogged(int,
LogController)
but returns true if one of the specified log controllers yields a positive
result.
severity - Severity of message to be writtenrelatives - Related log controllersbeLogged(int)public boolean beDebug()
beLogged(int)
but always checks for a debug message, that is a message with severity
Severity.DEBUG.
public boolean beDebug(LogController relative)
beLogged(int,
LogController)
but always checks for a debug message, that is a message with severity
Severity.DEBUG.
relative - Log controller that is related to this onepublic boolean beDebug(LogController[] relatives)
beLogged(int,
LogController[])
but always checks for a debug message, that is a message with severity
Severity.DEBUG.
relatives - Log controllers that are related to this onepublic boolean bePath()
beLogged(int)
but always checks for a path message, that is a message with severity
Severity.PATH.
public boolean bePath(LogController relative)
beLogged(int,
LogController)
but always checks for a path message, that is a message with severity
Severity.PATH.
relative - Log controller that is related to this onepublic boolean bePath(LogController[] relatives)
beLogged(int,
LogController[])
but always checks for a path message, that is a message with severity
Severity.PATH.
relatives - Log controllers that are related to this onepublic boolean beInfo()
beLogged(int)
but always checks for an informational message, that is a message with
severity
Severity.INFO.
public boolean beInfo(LogController relative)
beLogged(int,
LogController)
but always checks for an informational message, that is a message with
severity
Severity.INFO.
relative - Log controller that is related to this onepublic boolean beInfo(LogController[] relatives)
beLogged(int,
LogController[])
but always checks for an informational message, that is a message with
severity
Severity.INFO.
relatives - Log controllers that are related to this onepublic boolean beWarning()
beLogged(int)
but always checks for a warning message, that is a message with severity
Severity.WARNING.
public boolean beWarning(LogController relative)
beLogged(int,
LogController)
but always checks for a warning message, that is a message with severity
Severity.WARNING.
relative - Log controller that is related to this onepublic boolean beWarning(LogController[] relatives)
beLogged(int,
LogController[])
but always checks for a warning message, that is a message with severity
Severity.WARNING.
relatives - Log controllers that are related to this onepublic boolean beError()
beLogged(int)
but always checks for an error message, that is a message with severity
Severity.ERROR.
public boolean beError(LogController relative)
beLogged(int,
LogController)
but always checks for an error message, that is a message with severity
Severity.ERROR.
relative - Log controller that is related to this onepublic boolean beError(LogController[] relatives)
beLogged(int,
LogController[])
but always checks for an error message, that is a message with severity
Severity.ERROR.
relatives - Log controllers that are related to this onepublic boolean beFatal()
beLogged(int)
but always checks for a fatal error message, that is a message with
severity
Severity.FATAL.
public boolean beFatal(LogController relative)
beLogged(int,
LogController)
but always checks for a fatal error message, that is a message with
severity
Severity.FATAL.
relative - Log controller that is related to this onepublic boolean beFatal(LogController[] relatives)
beLogged(int,
LogController[])
but always checks for a fatal error message, that is a message with
severity
Severity.FATAL.
relatives - Log controllers that are related to this onepublic boolean beGroup()
beLogged(int)public boolean isActivityTracking(int severity)
public static void setActivityTracking(com.sap.tc.logging.interfaces.ISATChecker value)
public boolean getIsActivityTrackingEnabled()
public int getLoggedCount()
public void resetLoggedCount()
public int getLoggedCnt()
protected Map getLocalLogsMap()
protected String[] convertRelatives(LogController[] relatives)
protected LogRecord logIntByAPI(int severity,
Location loc,
String subloc,
String msgCode,
String msgClear,
Object[] args)
protected LogRecord logIntByAPI(int severity,
Location loc,
String subloc,
String msgCode,
String msgClear,
Object[] args,
Throwable exc)
protected LogRecord catchingIntByAPI(Throwable exc)
protected LogRecord messageInternal(LogRecord rec)
throws Exception
Exception
public static String replaceArguments(String message,
Object[] args)
public static String replaceException(LogRecord rec,
String msg)
protected int typeOfMessage(Object[] args)
protected LogRecord messageInt(LogRecord rec)
public boolean isCopyToSubtree()
public void setCopyToSubtree(boolean copyToSubtree)
copyToSubtree - The copyToSubtree to set.public boolean isInheritFromParent()
public static void resetSeverityCounters()
public static long getDebugCounter()
public static long getPathCounter()
public static long getInfoCounter()
public static long getWarningCounter()
public static long getErrorCounter()
public static long getFatalCounter()
public static long getTotalLogsCount()
| 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 | |||||||||