|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.log.impl.Log
org.openmdx.kernel.log.SysLog
public class SysLog
SysLog wraps the Log class to do application-general
logging. It provides a singleton accessor, along with lots of
handy class method {static} accessors.
| Field Summary |
|---|
| Fields inherited from class org.openmdx.kernel.log.impl.Log |
|---|
isMicrosoftVM |
| Method Summary | |
|---|---|
static void |
criticalError(String logString)
Logs a text string at CRITICAL_ERROR_LEVEL. |
static void |
criticalError(String logString,
Object logObj)
Logs a text string at CRITICAL_ERROR_LEVEL. |
static void |
criticalError(String logString,
Object logObj,
int callStackOff)
Logs a text string at CRITICAL_ERROR_LEVEL. |
static void |
detail(String logString)
Logs a text string at DETAIL_LEVEL. |
static void |
detail(String logString,
Object logObj)
Logs a text string at DETAIL_LEVEL. |
static void |
detail(String logString,
Object logObj,
int callStackOff)
Logs a text string at DETAIL_LEVEL. |
static void |
error(String logString)
Logs a text string at ERROR_LEVEL. |
static void |
error(String logString,
Object logObj)
Logs a text string at ERROR_LEVEL. |
static void |
error(String logString,
Object logObj,
int callStackOff)
Logs a text string at ERROR_LEVEL. |
static ConfigManager |
getConfigManager()
Returns the configuration manager. |
static Config |
getLogConfig()
Returns the logger's configuration object |
static Log |
getLogger()
Returns the logger |
static void |
info(String logString)
Logs a text string at INFO_LEVEL. |
static void |
info(String logString,
Object logObj)
Logs a text string at INFO_LEVEL. |
static void |
info(String logString,
Object logObj,
int callStackOff)
Logs a text string at INFO_LEVEL. |
static boolean |
isTraceOn()
Checks if trace logging is active |
static void |
performance(String logString,
long elapsedTime)
Logs a text string and an elapsed time at PERFORMANCE_LEVEL. |
static void |
performance(String logString,
long elapsedTime,
int callStackOff)
Logs a text string and an elapsed time at PERFORMANCE_LEVEL. |
static void |
register(Config config)
Register a Logger by its configuration object. |
static void |
setConfigName(String cfgName)
Set the config name that the logs pertain to. |
static void |
setLogProperties(Properties props)
Sets the log properties [Config-Level-3]. |
static void |
setLogSource(Object logSource)
Set a log source object. |
static void |
statistics(String group,
String record)
Logs a text string at STATISTICS_LEVEL. |
static void |
statistics(String group,
String record,
int callStackOff)
Logs a text string at STATISTICS_LEVEL. |
static void |
trace(String logString)
Logs a text string at TRACE_LEVEL. |
static void |
trace(String logString,
Object logObj)
Logs a text string at TRACE_LEVEL. |
static void |
trace(String logString,
Object logObj,
int callStackOff)
Logs a text string at TRACE_LEVEL. |
static void |
unregister(Config config)
Unregister a logger. |
static void |
warning(String logString)
Logs a text string at WARNING_LEVEL. |
static void |
warning(String logString,
Object logObj)
Logs a text string at WARNING_LEVEL. |
static void |
warning(String logString,
Object logObj,
int callStackOff)
Logs a text string at WARNING_LEVEL. |
| Methods inherited from class org.openmdx.kernel.log.impl.Log |
|---|
finalize, getActiveEntities, getBootstrapLogger, getConfig, getDateOpened, getHostName, getLogClassName, getLoggingLevel, getLogProperties, getMechanismManager, getName, getReadableEntities, getReader, getRemoveableEntities, isBooted, isLoggingPerformance, isLoggingStatistics, loadConfig, loadMechanisms, logEvent, logString, mechanismAddedEvent, mechanismRemovedEvent, newLog, removeEntity, setApplicationControlledTrace, setLoggingLevel, setLoggingPerformance, setLoggingStatistics, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static void setConfigName(String cfgName)
cfgName - a config namepublic static void setLogSource(Object logSource)
Dynamic log source example:
class LogSource
{
public String toString()
{
return "LogSource-" + System.currentTimeMillis();
}
}
LogSource logSource = new LogSource();
SysLog.setLogSource(logSource)
Static log source example:
SysLog.setLogSource("LogSource")
logSource - a log source objectpublic static void setLogProperties(Properties props)
properties - the propertiespublic static Config getLogConfig()
public static ConfigManager getConfigManager()
public static boolean isTraceOn()
Applications can use this method before they call SysLog.trace(...) if the log string creation is very time consuming.
SysLog.trace("Customer created", "First=Mark, Last=Smith");
if (SysLog.isTraceOn()) {
summary = expensive_creation();
detail = expensive_creation();
SysLog.trace(summary, detail);
}
public static void criticalError(String logString,
Object logObj)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.criticalError(String),
criticalError(String, Object, int)public static void criticalError(String logString)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.criticalError(String, Object),
criticalError(String, Object, int)
public static void criticalError(String logString,
Object logObj,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.callStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...criticalError(String),
criticalError(String, Object)
public static void error(String logString,
Object logObj)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.error(String),
error(String, Object, int)public static void error(String logString)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.error(String, Object),
error(String, Object, int)
public static void error(String logString,
Object logObj,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.callStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...error(String),
error(String, Object)
public static void warning(String logString,
Object logObj)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.warning(String),
warning(String, Object, int)public static void warning(String logString)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.warning(String, Object),
warning(String, Object, int)
public static void warning(String logString,
Object logObj,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.callStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...warning(String),
warning(String, Object)
public static void info(String logString,
Object logObj)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.info(String),
info(String, Object, int)public static void info(String logString)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.info(String, Object),
info(String, Object, int)
public static void info(String logString,
Object logObj,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.callStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...info(String),
info(String, Object)
public static void detail(String logString,
Object logObj)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.detail(String),
detail(String, Object, int)public static void detail(String logString)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.detail(String, Object),
detail(String, Object, int)
public static void detail(String logString,
Object logObj,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.callStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...detail(String),
detail(String, Object)
public static void trace(String logString,
Object logObj)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.trace(String),
trace(String, Object, int)public static void trace(String logString)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.trace(String, Object),
trace(String, Object, int)
public static void trace(String logString,
Object logObj,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.logObj - a log object providing detail information. The log object is
stringified using its toString method before getting
logged. The log object may be a null object. If the log object
is a Throwable it's message and stack trace is
logged.callStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...trace(String),
trace(String, Object)
public static void performance(String logString,
long elapsedTime)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.elapsedTime - the elapsed time in milli secondsperformance(String, long, int)
public static void performance(String logString,
long elapsedTime,
int callStackOff)
logString - a concise summary message. The message must be single line and
must therefore not contain any '\r' or '\n' characters. The '\r'
and '\n' characters are removed silently from the message.elapsedTime - the elapsed time in milli secondscallStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...performance(String, long)
public static void statistics(String group,
String record)
group - a statistics group.info - a statistics record stringstatistics(String, String, int)
public static void statistics(String group,
String record,
int callStackOff)
group - a statistics group.info - a statistics record stringcallStackOff - a call stack correction offset. The offset must be a positive
number: 0, 1, 2, 3, ...statistics(String, String)public static void register(Config config)
config - a configuration object that belongs to a static logger classpublic static void unregister(Config config)
config - a configuration object that belongs to a static logger classpublic static Log getLogger()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||