|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.ubicollab.osgi.Log
public class Log
This Class is responsible for the logging of events, and for reading and returning
the log on request. The log file will be created in the folder specified in
GlobalSettings.STORAGE_ROOT
on the system drive.
This class is created as a singleton class to enable logging from everywhere without having to pass around a instance refrence. An instance might not be needed at all.
Field Summary | |
---|---|
static int |
DEBUG
The Constant DEBUG describes the given log-level. |
static int |
ERROR
The Constant ERROR describes the given log-level. |
static int |
FATAL
The Constant FATAL describes the given log-level. |
static int |
INFO
The Constant INFO describes the given log-level. |
static int |
WARNING
The Constant WARNING describes the given log-level. |
Method Summary | |
---|---|
static Log |
getInstance()
Method to get a refrence to the instance. |
java.lang.String |
readFromLog(java.lang.String logLevel,
int numItems)
Read from the log and return selected log items in a XML-formatted string. |
void |
writeToLog(java.lang.String message,
int level)
Method to write a new record (og item) in the log. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEBUG
public static final int INFO
public static final int WARNING
public static final int ERROR
public static final int FATAL
Method Detail |
---|
public static Log getInstance()
public void writeToLog(java.lang.String message, int level)
message
will be written to standard
output.
level
- The log-level for the message
.message
- The String
g to write to the logpublic java.lang.String readFromLog(java.lang.String logLevel, int numItems)
The xml-structure used to represent the returned log is:
<?xml version='1.0'?> <Log> <Logitem Date="dd.mm.yyyy" Time="hh:mm:ss" Level="String" Message="String"/>
... more log items ...
</Log>
logLevel
- The log level to include in the report. Valid arguments are:
'DEBUG', 'INFO', 'WARNING', 'ERROR', 'FATAL' and 'ALL' for all types.numItems
- The number of log items to include in the report
String
containg the resulting XML
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |