|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.service.log.PerformanceLogger
This class is used for performance logging of the agent platform activity.
If the class gets instantiated, the current system time is stored internally. Each log message then is extended
by the difference between the current system time and the starting time (in milliseconds).
A new start time is set, if logStart(java.lang.String, int, java.lang.String, java.lang.String)
is used for logging.
Note: Keep in mind, that logging to a file (and even creating log messages) costs time and might falsify the results!
Note: The class needs no special synchronization, because the underlying ILogger
class is synchronized.
Constructor Summary | |
PerformanceLogger()
Empty constructor. |
|
PerformanceLogger(ILogger logger)
Constructor including the ILogger where the log messages get stored. |
|
PerformanceLogger(String logFileName)
Constructor that includes trying to open the file where the log messages get stored. |
|
PerformanceLogger(String logFileName,
Map replacementMap)
Constructor that includes trying to open the file where the log messages get stored. |
Method Summary | |
void |
log(String className,
int logType,
String methodName,
String logNotice)
Logs a given notice including the difference between the current system time and the start time, if the given logLevel is equal or more important than the log level of the used ILogger. |
void |
logStart(String className,
int logType,
String methodName,
String logNotice)
Logs a given notice including the current system time in milliseconds, if the given logLevel is equal or more important than the log level of the used ILogger. |
boolean |
setLogFile(String logFileName)
changes the log file to another file |
void |
setLogLevel(int logLevel)
Sets the log level of the used agent log. |
void |
setLogLevel(String logLevel)
Sets the log level of the used agent log. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PerformanceLogger() throws BaseRuntimeException
setLogFile(String)
method is not called).BaseRuntimeException
- If the LoggerFactory fails to create an ILogger instanceLoggerFactory
,
ILogger
public PerformanceLogger(String logFileName) throws BaseRuntimeException
logFileName
- name of the log fileBaseRuntimeException
- If the LoggerFactory fails to create an ILogger instanceLoggerFactory
,
ILogger
public PerformanceLogger(String logFileName, Map replacementMap) throws BaseRuntimeException
logFileName
- name of the log filereplacementMap
- map containing variable/value pairs for substitutions in the log file nameBaseRuntimeException
- If the LoggerFactory fails to create an ILogger instanceLoggerFactory
,
ILogger
public PerformanceLogger(ILogger logger)
ILogger
where the log messages get stored.logger
- log file to be usedMethod Detail |
public void setLogLevel(int logLevel)
logLevel
- log level as an integer (use constants defined in ILogger like ILogger.WARNING)public void setLogLevel(String logLevel) throws LogException
logLevel
- name of one of the in ILogger defined constants (e.g. "error"), case is ignoredLogException
- If given log level is null or unknownpublic void logStart(String className, int logType, String methodName, String logNotice)
className
- name of the class in which the log message was createdlogType
- level of the message (SysLog.TRACE5 ... SysLog.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 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 (SysLog.TRACE5 ... SysLog.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 boolean setLogFile(String logFileName)
logFileName
- name of the file to be used as log file
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |