|
|||||||||||
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.AppLog
AppLog of the Mobile Infrastructure. Use this log to inform the
administrator about unexpected situations on the client. With every
synchroization this log will be sent to the backend system (if the log is
not empty). Therefore log messages only that can be handled by the
administrator. For other messages use the Trace
.
The administrator watch the logs on the server. If there are messages with
ERROR
or FATAL
severity the administrator gets a
red light, if there are messages with WARNING
severity the
administrator gets a yellow light.
The default effective severity level for this log is WARNING
,
the log is activated by default and a DefaultFileLogWriter
is
used for writing messages.
Example :
private static final String
COMPONENTNAME = "MyApplication/MyComponent" ;
...
private static AppLog applog =
AppLog.getInstance(COMPONENTNAME);
try {
...
} catch (Exception e) {
applog.logException(Severities.ERROR, "Exception while ...", e,
true );
}
Severities
,
Trace
,
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 AppLog |
getInstance(java.lang.String componentname)
Gets the instance attribute of the AppLog class |
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 AppLog object |
boolean |
isOn()
Gets the current activation state of the log. |
void |
log(int severity,
java.lang.String message)
Logs the message if log is switched on and the given severity will be logged. |
void |
log(int severity,
java.lang.String message,
java.lang.Object param)
Logs the message if log is switched on and the given severity will be logged. |
void |
log(int severity,
java.lang.String message,
java.lang.Object[] params)
Logs the message if log is switched on and the given severity will be logged. |
void |
log(int severity,
java.lang.String message,
java.lang.Object param1,
java.lang.Object param2)
Logs the message if log is switched on and the given severity will be logged. |
void |
log(int severity,
java.lang.String message,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3)
Logs the message if log is switched on and the given severity will be logged. |
void |
log(java.lang.String message)
Logs the message if log is switched on and severity INFO_LEVEL
will be logged. |
void |
log(java.lang.String message,
java.lang.Object param1)
Logs the message if log is switched on and severity INFO_LEVEL
will be logged. |
void |
log(java.lang.String message,
java.lang.Object[] params)
Logs the message if log is switched on and severity INFO_LEVEL
will be logged. |
void |
log(java.lang.String message,
java.lang.Object param1,
java.lang.Object param2)
Logs the message if log is switched on and severity INFO_LEVEL
will be logged. |
void |
log(java.lang.String message,
java.lang.Object param1,
java.lang.Object param2,
java.lang.Object param3)
Logs the message if log is switched on and severity INFO_LEVEL
will be logged. |
void |
logException(int severity,
java.lang.String message,
java.lang.Object[] params,
java.lang.Throwable t,
boolean printStackTrace)
Logs an Exception with the given message if log is switched on. |
void |
logException(int severity,
java.lang.String message,
java.lang.Throwable t,
boolean printStackTrace)
Logs an Exception with the given message if log is switched on. |
void |
logException(int severity,
java.lang.Throwable t)
Logs an Exception without any additional message if log is switched on. |
void |
logException(int severity,
java.lang.Throwable t,
boolean printStackTrace)
Logs an Exception without any additional message if log is switched on. |
void |
logException(java.lang.String message,
java.lang.Throwable t,
boolean printStackTrace)
Logs an Exception with the given message if log is switched on. |
void |
logException(java.lang.Throwable t)
Logs an Exception without any additional message if log is switched on. |
void |
logException(java.lang.Throwable t,
boolean printStackTrace)
Logs an Exception without any additional message if log is switched on. |
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, 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 AppLog getInstance(java.lang.String componentname)
componentname
- Description of the Parameter
public 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 log(int severity, java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
log
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.param1
- The first parameter for the message. See java.text.MessageFormat
.param2
- The second parameter for the message. See java.text.MessageFormat
.param3
- The third parameter for the message. See java.text.MessageFormat
.for further details.
public void log(int severity, java.lang.String message, java.lang.Object param1, java.lang.Object param2)
log
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.param1
- The first parameter for the message. See java.text.MessageFormat
.param2
- The second parameter for the message. See java.text.MessageFormat
.for further details.
public void log(int severity, java.lang.String message, java.lang.Object param)
log
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.param
- The parameter for the message. See java.text.MessageFormat
.for further details.
public void log(int severity, java.lang.String message, java.lang.Object[] params)
log
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.params
- The parameter list for the message. See java.text.MessageFormat
.for further details.
public void log(int severity, java.lang.String message)
log
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged.public void log(java.lang.String message, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
INFO_LEVEL
will be logged. The severity for this message is INFO_LEVEL
.
Logs the message to the trace too, if trace is activated.
log
in class AbstractLogging
message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.param1
- The first parameter for the message. See java.text.MessageFormat
.param2
- The second parameter for the message. See java.text.MessageFormat
.param3
- The third parameter for the message. See java.text.MessageFormat
.for further details.
public void log(java.lang.String message, java.lang.Object param1, java.lang.Object param2)
INFO_LEVEL
will be logged. The severity for this message is INFO_LEVEL
.
Logs the message to the trace too, if trace is activated.
log
in class AbstractLogging
message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.param1
- The first parameter for the message. See java.text.MessageFormat
.param2
- The second parameter for the message. See java.text.MessageFormat
.for further details.
public void log(java.lang.String message, java.lang.Object param1)
INFO_LEVEL
will be logged. The severity for this message is INFO_LEVEL
.
Logs the message to the trace too, if trace is activated.
log
in class AbstractLogging
message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.param1
- The first parameter for the message. See java.text.MessageFormat
.for further details.
public void log(java.lang.String message, java.lang.Object[] params)
INFO_LEVEL
will be logged. The severity for this message is INFO_LEVEL
.
Logs the message to the trace too, if trace is activated.
log
in class AbstractLogging
message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.params
- The parameter list for the message. See java.text.MessageFormat
.for further details.
public void log(java.lang.String message)
INFO_LEVEL
will be logged. The severity for this message is INFO_LEVEL
.
Logs the message to the trace too, if trace is activated.
log
in class AbstractLogging
message
- The message that has to be logged.public void logException(int severity, java.lang.String message, java.lang.Object[] params, java.lang.Throwable t, boolean printStackTrace)
true
the stacktrace of the exception is logged to the trace.
logException
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged. See java.text.MessageFormat
for the format of this string.params
- The parameter list for the message. See java.text.MessageFormat
.t
- The Throwable that has to be logged.printStackTrace
- Indicates if the stack trace should be printed to
the trace.for further details.
public void logException(int severity, java.lang.String message, java.lang.Throwable t, boolean printStackTrace)
true
and trace is activated. The message will be logged to
the trace also if trace is activated.
logException
in class AbstractLogging
severity
- The severity for this message.message
- The message that has to be logged.t
- The Throwable that has to be logged.printStackTrace
- Indicates if the stack trace should be printed to
the trace.public void logException(int severity, java.lang.Throwable t, boolean printStackTrace)
true
and trace is activated. The message will be
logged to the trace also if trace is activated.
logException
in class AbstractLogging
severity
- The severity for this message.t
- The Throwable that has to be logged.printStackTrace
- Indicates if the stack trace should be printed to
the trace.public void logException(int severity, java.lang.Throwable t)
logException
in class AbstractLogging
severity
- The severity for this message.t
- The Throwable that has to be logged.public void logException(java.lang.String message, java.lang.Throwable t, boolean printStackTrace)
true
and trace is activated. The message will be logged with
severity ERROR_LEVEL
. Logs the message to the trace too, if
trace is activated.
logException
in class AbstractLogging
message
- The message that has to be logged.t
- The Throwable that has to be logged.printStackTrace
- Indicates if the stack trace should be printed to
the trace.public void logException(java.lang.Throwable t, boolean printStackTrace)
ERROR_LEVEL
. Logs
the message to the trace too, if trace is activated.
logException
in class AbstractLogging
t
- The Throwable that has to be logged.printStackTrace
- Indicates if the stack trace should be printed too.public void logException(java.lang.Throwable t)
ERROR_LEVEL
. Logs
the message to the trace too, if trace is activated.
logException
in class AbstractLogging
t
- The Throwable that has to be logged.public void refresh()
refresh
in class AbstractLogging
public int getEffectiveSeverity()
getEffectiveSeverity
in class AbstractLogging
public void setEffectiveSeverity(int level)
setEffectiveSeverity
in class AbstractLogging
level
- The new effectiveSeverity valuepublic 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 |