|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.service.log.SystemLogger
Agents not contained in the com.ls.lars package are not allowed to use this class,
but should use an instance of ILogger
.
Due to downward compatibility reasons this is not forced, but only solicited.
This class is responsible for the logging of activities of components contained in the com.ls.lars package.
There exist 8 different log levels: error (most important), warning, info and five different trace levels
(trace1, .., trace5).
It depends on the log level of the message and on the system's log level, if a log message gets written: If the
log level of the message is at least as important as the system's log level, the message is written, otherwise
it is ignored.
The log message gets written in a log file, if such a logfile got specified and opened successfully
afterwards - else the log messages are written to System.out. Specifying and opening a log file can be done in
with help of the setLogFile(java.lang.String)
method.
Note: None of the methods are synchronized, because internally AgentLog is used for logging and the critical sections are synchronized there!
Agents not contained in the com.ls.lars package are not allowed to use this class,
but should use an instance of ILogger
.
Due to downward compatibility reasons this is not forced, but only solicited.
Constructor Summary | |
SystemLogger()
|
Method Summary | |
static boolean |
canLog(int logLevel)
detemines, if a notice with the given log level will be logged |
static String |
getLogFileName()
gets name of logfile, which is currently in use |
static ILogger |
getLogger()
returns the reference of ILogger used from SystemLogger |
static int |
getLogLevel()
Returns the current loglevel as number. |
static String |
getLogLevelString()
Returns gets the name of the current log level. |
static byte |
getLogType()
returns the type of the logger |
static void |
log(ILogger additionalLogger,
String className,
int logType,
String methodName,
Object[] logNotice)
Logs a given notice, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
int logType,
String methodName,
Object[] logNotice,
Throwable throwable)
Logs a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
int logType,
String methodName,
String logNotice)
Logs a given notice, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
int logType,
String methodName,
String logNotice,
Throwable throwable)
Logs a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
int logType,
String methodName,
Throwable throwable)
Logs a given exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
String componentName,
int logType,
String methodName,
Object[] logNotice)
Logs a given notice, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
String componentName,
int logType,
String methodName,
Object[] logNotice,
Throwable throwable)
Logs a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
String componentName,
int logType,
String methodName,
String logNotice)
Logs a given notice, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
String componentName,
int logType,
String methodName,
String logNotice,
Throwable throwable)
Logs a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(ILogger additionalLogger,
String className,
String componentName,
int logType,
String methodName,
Throwable throwable)
Logs a given exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
int logType,
String methodName,
Object[] logNotice)
Writes a log message, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
int logType,
String methodName,
Object[] logNotice,
Throwable throwable)
Writes a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
int logType,
String methodName,
String logNotice)
Writes a log message, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
int logType,
String methodName,
String logNotice,
Throwable throwable)
Writes a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
int logType,
String methodName,
Throwable throwable)
Logs an exception including its stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
String componentName,
int logType,
String methodName,
Object[] logNotice)
Writes a log message (the logging component is identified with help of the componentName!) |
static void |
log(String className,
String componentName,
int logType,
String methodName,
Object[] logNotice,
Throwable throwable)
Writes a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
String componentName,
int logType,
String methodName,
String logNotice)
Writes a log message (the logging component is identified with help of the componentName!) |
static void |
log(String className,
String componentName,
int logType,
String methodName,
String logNotice,
Throwable throwable)
Writes a given notice and an exception including a stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
log(String className,
String componentName,
int logType,
String methodName,
Throwable throwable)
Logs an exception including its stack trace, if the given logType is equal or more important than the configured system log level. |
static void |
logSystemInformation()
logs system dependant information with help of ILogger.logSystemInformation() into the system's log
file |
static boolean |
setLogFile(String logFileName)
changes the log file to another file |
static void |
setLogLevel(int logLevel)
Sets the system's log level. |
static void |
setLogLevel(String logLevel)
Sets the system's log level. |
static void |
setLogType(byte logType)
Changes the type of the logger with the type of logger specified as a parameter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SystemLogger()
Method Detail |
public static void setLogLevel(int logLevel)
logLevel
- log level as an integer (use defined constants like ILogger.WARNING)public static void setLogLevel(String logLevel) throws LogException
logLevel
- name of one of the defined constants (e.g. "error"), case is ignoredLogException
- If given log level is null or unknownpublic static int getLogLevel()
public static String getLogLevelString()
public static ILogger getLogger()
public static void setLogType(byte logType) throws LogException
logType
- the new type of the logging systemLogException
- If any error occurspublic static byte getLogType()
public static boolean setLogFile(String logFileName)
logFileName
- name of the file to be used as log filepublic static String getLogFileName()
public static void logSystemInformation()
ILogger.logSystemInformation()
into the system's log
filepublic static boolean canLog(int logLevel)
logLevel
- log level to compare against the configured log levelpublic static void log(String className, int logType, String methodName, String logNotice)
className
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the logMessage was createdlogNotice
- content of the log messagepublic static void log(String className, String componentName, int logType, String methodName, String logNotice)
className
- name of the class in which the log message was createdcomponentName
- name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagepublic static void log(String className, int logType, String methodName, Object[] logNotice)
className
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the logMessage was createdlogNotice
- content of the log messagepublic static void log(String className, String componentName, int logType, String methodName, Object[] logNotice)
className
- name of the class in which the log message was createdcomponentName
- name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagepublic static void log(ILogger additionalLogger, String className, String componentName, int logType, String methodName, String logNotice)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdcomponentName
- string that identifies the logging component (usually the thread name)logType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagepublic static void log(ILogger additionalLogger, String className, int logType, String methodName, String logNotice)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagepublic static void log(ILogger additionalLogger, String className, String componentName, int logType, String methodName, Object[] logNotice)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdcomponentName
- string that identifies the logging component (usually the thread name)logType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagepublic static void log(ILogger additionalLogger, String className, int logType, String methodName, Object[] logNotice)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagepublic static void log(String className, String componentName, int logType, String methodName, String logNotice, Throwable throwable)
className
- name of the class in which the log message was createdcomponentName
- name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(String className, int logType, String methodName, String logNotice, Throwable throwable)
className
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(String className, String componentName, int logType, String methodName, Object[] logNotice, Throwable throwable)
className
- name of the class in which the log message was createdcomponentName
- name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(String className, int logType, String methodName, Object[] logNotice, Throwable throwable)
className
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(ILogger additionalLogger, String className, String componentName, int logType, String methodName, String logNotice, Throwable throwable)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdcomponentName
- Name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(ILogger additionalLogger, String className, int logType, String methodName, String logNotice, Throwable throwable)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(ILogger additionalLogger, String className, String componentName, int logType, String methodName, Object[] logNotice, Throwable throwable)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdcomponentName
- Name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(ILogger additionalLogger, String className, int logType, String methodName, Object[] logNotice, Throwable throwable)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdlogNotice
- content of the log messagethrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(String className, int logType, String methodName, Throwable throwable)
className
- name of the class in which the logMessage was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdthrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(String className, String componentName, int logType, String methodName, Throwable throwable)
className
- name of the class in which the logMessage was createdcomponentName
- name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdthrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(ILogger additionalLogger, String className, String componentName, int logType, String methodName, Throwable throwable)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the logMessage was createdcomponentName
- name of the component in which the log message was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdthrowable
- Throwable (Exception or Error) which should be loggedpublic static void log(ILogger additionalLogger, String className, int logType, String methodName, Throwable throwable)
additionalLogger
- log file of the agent (that owns the logging component) where the same log message
(with the same log level) should be loggedclassName
- name of the class in which the logMessage was createdlogType
- level of the message (ILogger.TRACE5 ... ILogger.ERROR) determining, if the notice gets
logged or ignoredmethodName
- name of the method in which the log message was createdthrowable
- Throwable (Exception or Error) which should be logged
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |