java.lang.Object
konspire.common.log.Log
konspire.common.log.MultiThreadLog
- public class MultiThreadLog
- extends Log
MultiThreadLog is an extension of the
Log class to add information to each log
entry specifying the thread that generated the entry. In a
multi-threaded application, a particular log file may be
intermixed with a number of entries from a number of
threads. To make sense of what is going on in a particular
thread, this type of log will prepend all entries with the name
of the thread, so you can "grep" out a particular thread of
interest.
Like the Log class, this class could be extended to do
application-specific behavior,
or better yet you could create a class "wrapper" like AppLog
to make instances well-known Singletons with handy static/class methods.
- Version:
- $Revision: 1.3 $
| Fields inherited from class konspire.common.log.Log |
CRITICAL_ERROR_LEVEL, currentLoggingLevel, dateOpened, DEACTIVATE_LEVEL, DETAIL_LEVEL, ERROR_LEVEL, INFO_LEVEL, logFieldSeparator, loggingMechanisms, name, SHARED_DATED_FILE_MECHANISM, SHARED_FILE_MECHANISM, STANDARD_ERR_MECHANISM, TRACE_LEVEL, UNIQUE_DATED_FILE_MECHANISM, UNIQUE_FILE_MECHANISM, WARNING_LEVEL |
|
Method Summary |
void |
logString(java.lang.String logString,
int loggingLevel)
Adds a message string to the log if the log's level is
currently set at or above the loggingLevel passed in. |
| Methods inherited from class konspire.common.log.Log |
addLoggingMechanism, finalize, getDateOpened, getLogFieldSeparator, getLoggingLevel, getLoggingMechanism, getLoggingMechanisms, getName, isOpen, removeAllLoggingMechanisms, removeLoggingMechanism, setLogFieldSeparator, setLoggingLevel |
MultiThreadLog
public MultiThreadLog(java.lang.String name)
- Public constructor to register a new
MultiThreadLog
with a particular name.
The name of the log is very important. It is used as a key into
the log properties file to find settings for how the log is to
be opened.
logString
public void logString(java.lang.String logString,
int loggingLevel)
- Adds a message string to the log if the log's level is
currently set at or above the loggingLevel passed in.
Prepends the current thread name before the log entry.
- Overrides:
logString in class Log