|
|||||||||||
| 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, getLogLevelName, log, log, log, log, log, log, log, log, log, log, logException, logException, logException, logException, logException, logException, logException, logFileContent, logFileContent, read, 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 Trace getInstance(java.lang.String componentname)
componentname - Description of the Parameter
public boolean isLogging(int severity)
isLogging in class AbstractLoggingseverity - Description of the Parameter
public boolean switchOn(boolean on)
switchOn in class AbstractLoggingon - Description of the Parameter
public java.lang.String getLogName()
public void refresh()
refresh in class AbstractLoggingpublic int getEffectiveSeverity()
getEffectiveSeverity in class AbstractLoggingpublic void setEffectiveSeverity(int level)
setEffectiveSeverity in class AbstractLogginglevel - The new effectiveSeverity valuepublic boolean isOn()
isOn in class AbstractLoggingtrue iff log is on.protected LogWriter getLogWriter()
getLogWriter in class AbstractLoggingprotected 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 AbstractLoggingnewLogWriter - The new LogWriter instanceprotected void readConfiguration(java.lang.String logName)
readConfiguration in class AbstractLogginglogName - The name of the log.protected void setOn(boolean newon)
setOn in class AbstractLoggingnewon - 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 | ||||||||||