|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface file for all log algorithms.
Field Summary | |
static int |
ERROR
Declares a log message as an error. |
static int |
INFO
Declares a log message as a programmer's information for the log file reader. |
static int |
LEVEL_INDEPENDENT
Declares a log message as to be logged always (independent of the configured log level). |
static String[] |
LOG_LEVEL
contains the (lower case) names of the log levels starting with "error" and ending with "trace5" |
static int |
MAX_LOG_LEVEL
least important log level (the one, which produces the most log messages) |
static String |
TAG_GLOBAL_LOG_PATH
defines the global log path tag for configuration files |
static String |
TAG_LOG_FILE
defines the log file tag for configuration files |
static String |
TAG_LOG_LEVEL
defines the log level tag for configuration files |
static String |
TAG_LOG_TYPE
defines the log type tag for configuration files |
static int |
TRACE
same as TRACE1, remains for compatibility reasons only |
static int |
TRACE1
declares a log message as a debug information of trace level 1 (most important trace level) |
static int |
TRACE2
declares a log message as a debug information of trace level 2 |
static int |
TRACE3
declares a log message as a debug information of trace level 3 |
static int |
TRACE4
declares a log message as a debug information of trace level 4 |
static int |
TRACE5
declares a log message as a debug information of trace level 5 (least important trace level) |
static int |
WARNING
Declares a log message as a warning. |
Method Summary | |
boolean |
canLog(int logLevel)
determines, if a notice with the given log level will be logged |
void |
closeLogFile()
Closes the log file. |
String |
getLogFileName()
gets name of log file, which is currently in use |
int |
getLogLevel()
Returns the current loglevel as number. |
String |
getLogLevelString()
Returns gets the name of the current log level. |
byte |
getLogType()
Returns the current logging type as a byte. |
String |
getLogTypeString()
Returns the name of current logging type as a String ('LARS' or 'LOG4J'). |
boolean |
hasLogFile()
Checks, if this Logger instance uses a log file or System.out for logging. |
void |
log(String className,
int logLevel,
String methodName,
Object[] logNotice)
Logs a given notice, if the given logLevel is equal or more important than the configured agent log level. |
void |
log(String className,
int logLevel,
String methodName,
Object[] logNotice,
Throwable throwable)
Logs a given notice and a throwable (Exception or Error) including a stack trace, if the given logLevel is equal or more important than the configured agent log level. |
void |
log(String className,
int logLevel,
String methodName,
String logNotice)
Logs a given notice, if the given logLevel is equal or more important than the configured agent log level. |
void |
log(String className,
int logLevel,
String methodName,
String logNotice,
Throwable throwable)
Logs a given notice and a throwable (Exception or Error) including a stack trace, if the given logLevel is equal or more important than the configured agent log level. |
void |
log(String className,
int logLevel,
String methodName,
Throwable throwable)
Logs a throwable (Exception or Error) including a stack trace, if the given logLevel is equal or more important than the configured agent log level. |
void |
logSystemInformation()
calls logSystemInformation on all configured system error log implementations and logs the output with log level LEVEL_INDEPENDENT to this log file |
void |
logThreadName(boolean loggingThreadName)
turns on or off the thread name specification |
void |
replacementMapPutAll(Map map)
Puts map to the replacement map, which is used for exchanging variables in a logfile's name with values (for example replace $A with the name of the owning agent). |
boolean |
setLogFile(String logFileName)
changes the log file to another file |
void |
setLogLevel(int logLevel)
Sets the agent's log level. |
void |
setLogLevel(String logLevel)
Sets the agent's log level. |
Field Detail |
public static final int LEVEL_INDEPENDENT
public static final int ERROR
public static final int WARNING
public static final int INFO
public static final int TRACE
public static final int TRACE1
public static final int TRACE2
public static final int TRACE3
public static final int TRACE4
public static final int TRACE5
public static final int MAX_LOG_LEVEL
public static final String[] LOG_LEVEL
public static final String TAG_LOG_FILE
public static final String TAG_LOG_TYPE
public static final String TAG_LOG_LEVEL
public static final String TAG_GLOBAL_LOG_PATH
Method Detail |
public void log(String className, int logLevel, String methodName, Throwable throwable)
className
- Name of the class in which the log message was createdlogLevel
- 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) that should be loggedpublic void log(String className, int logLevel, String methodName, String logNotice)
className
- Name of the class in which the logMessage was createdlogLevel
- 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 logMessagepublic void log(String className, int logLevel, String methodName, Object[] logNotice)
className
- Name of the class in which the logMessage was createdlogLevel
- 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 logMessagepublic void log(String className, int logLevel, String methodName, String logNotice, Throwable throwable)
className
- name of the class in which the log message was createdlogLevel
- level of the message (Logger.TRACE5 ... Logger.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) that should be loggedpublic void log(String className, int logLevel, String methodName, Object[] logNotice, Throwable throwable)
className
- name of the class in which the log message was createdlogLevel
- level of the message (Logger.TRACE5 ... Logger.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) that should be loggedpublic void replacementMapPutAll(Map map)
map
- a Map containing replacement variables as keys and replacements as valuesHashMap.putAll(Map)
public byte getLogType()
public String getLogTypeString()
public void setLogLevel(int logLevel)
logLevel
- log level as an integer (use defined constants like ILogger.WARNING)public 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 int getLogLevel()
public String getLogLevelString()
public boolean setLogFile(String logFileName)
logFileName
- name of the file to be used as log filepublic String getLogFileName()
public void closeLogFile() throws LogException
LogException
- If any error occures while closing the log filepublic boolean hasLogFile()
public boolean canLog(int logLevel)
logLevel
- log level to compare against the configured log levelpublic void logSystemInformation()
LEVEL_INDEPENDENT
to this log filepublic void logThreadName(boolean loggingThreadName)
loggingThreadName
- specifies if the name of the thread is gona be logged
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |