|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.ip.me.api.logging.AbstractLogging
com.sap.ip.me.api.logging.Trace
The trace of the Mobile Infrastructure. The Mobile infrastructure manages
one trace for all applications only.
This log is disabeld by default and should be used for information and debug
purposes. A DefaultFileLogWriter
instance is used as default
log writer.
Example :
private static final String
COMPONENTNAME = "MyApplication/MyComponent" ;
...
private static Trace trace =
Trace.getInstance(COMPONENTNAME);
trace.log(Severities.DEBUG, "This is a simple debug message");
...
trace.log(Severities.DEBUG, "This is a message with some two argument ({0}
and {1})", "Object one", Integer.toString(4711 ));
try {
} catch (Exception e) {
// exception can be logged too
trace.logException(Severities.INFO, "Exception while ...", e,
true );
}
Severities
,
AppLog
,
AbstractLogging
Field Summary |
Fields inherited from class com.sap.ip.me.api.logging.AbstractLogging |
CONFIGURATION_PREFIX, LOG_ENABLED_SUFFIX, LOG_LEVEL_SUFFIX, LOGWRITER_IMPLEMENTATION_SUFFIX |
Method Summary | |
int |
getEffectiveSeverity()
Gets the current log level of the log |
static Trace |
getInstance(java.lang.String componentname)
Get the singleton instance of the trace. |
java.lang.String |
getLogName()
The name of the log will be returned. |
protected LogWriter |
getLogWriter()
Returns the LogWriter instance of this log. |
protected java.lang.String |
getLogWriterClassname()
Gets the configured filename / path of the log. |
boolean |
isLogging(int severity)
Gets the logging attribute of the Trace object |
boolean |
isOn()
Gets the current activation state of the log. |
protected void |
readConfiguration(java.lang.String logName)
Reads the configuration for the given log. |
void |
refresh()
Description of the Method |
void |
setEffectiveSeverity(int level)
Gets the current log level of the log |
protected void |
setLogWriter(LogWriter newLogWriter)
Sets the LogWriter instance. |
protected void |
setOn(boolean newon)
Sets the current activation state of the log. |
boolean |
switchOn(boolean on)
Description of the Method |
Methods inherited from class com.sap.ip.me.api.logging.AbstractLogging |
getComponent, getLogContentAsStream, getLogLevelName, getWriter, log, log, log, log, log, log, log, log, log, log, logException, logException, logException, logException, logException, logException, logException, logFileContent, logFileContent, read, releaseWriter, reset, setComponent, writeConfiguration |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final Trace getInstance(java.lang.String componentname)
componentname
- Description of the Parameter
public final boolean isLogging(int severity)
isLogging
in class AbstractLogging
severity
- Description of the Parameter
public boolean switchOn(boolean on)
switchOn
in class AbstractLogging
on
- Description of the Parameter
public java.lang.String getLogName()
public void refresh()
refresh
in class AbstractLogging
public final int getEffectiveSeverity()
getEffectiveSeverity
in class AbstractLogging
public void setEffectiveSeverity(int level)
setEffectiveSeverity
in class AbstractLogging
level
- The new effectiveSeverity valuepublic final boolean isOn()
isOn
in class AbstractLogging
true
iff log is on.protected LogWriter getLogWriter()
getLogWriter
in class AbstractLogging
protected void setLogWriter(LogWriter newLogWriter)
null
or it is not an instance of LogWriter
an
IllegalArgumentException will be thrown and the old log writes resists.
setLogWriter
in class AbstractLogging
newLogWriter
- The new LogWriter instanceprotected void readConfiguration(java.lang.String logName)
readConfiguration
in class AbstractLogging
logName
- The name of the log.protected void setOn(boolean newon)
setOn
in class AbstractLogging
newon
- The new on valueprotected java.lang.String getLogWriterClassname()
getLogWriterClassname
in class AbstractLogging
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |