|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.connectivity.oda.util.logging.LogManager
LogManager is a static class that maintains a set of named
Loggers
. It provides the interface to create
named Loggers
and to retrieve the loggers for
logging purposes.
Method Summary | |
static Logger |
createLogger(java.lang.String loggerName,
int logLevel,
java.lang.String logDirectory,
java.lang.String logPrefix,
java.lang.String formatterClassName)
Creates a named Logger with the necessary
log configuration information. |
static Logger |
getLogger(java.lang.String loggerName)
Gets a previously created Logger by name. |
static Logger |
getLogger(java.lang.String loggerName,
int logLevel,
java.lang.String logDirectory,
java.lang.String logPrefix,
java.lang.String formatterClassName)
Creates a named Logger with the specified log configuration
information, if the named Logger doesn't already exist. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Logger createLogger(java.lang.String loggerName, int logLevel, java.lang.String logDirectory, java.lang.String logPrefix, java.lang.String formatterClassName)
Logger
with the necessary
log configuration information. The specified logger name
should be specific to the application using the logging
framework to prevent name collision in the logger namespace,
since multiple loggers cannot be created with the same
logger name.
loggerName
- the name of the logger to be created.logLevel
- the logger log level.logDirectory
- the required directory to store the logs.logPrefix
- the required file name prefix of the log
file name; the format will be
<logPrefix>-YYMMDD-hhmmss.log.formatterClassName
- a LogFormatter
class
name; if this is null or empty, the
default LogFormatter
will be
used. The customized log formatter must inherit
from org.eclipse.datatools.connectivity.oda.logging.LogFormatter
and implements the format()
method.
Logger
.
java.lang.IllegalArgumentException
- if logger with the same name
already exists.public static Logger getLogger(java.lang.String loggerName, int logLevel, java.lang.String logDirectory, java.lang.String logPrefix, java.lang.String formatterClassName)
Logger
with the specified log configuration
information, if the named Logger
doesn't already exist. If the
named Logger
already exists, then it will be updated the specified log
configuration. If the specified log level or the formatter class is different,
then the new values will be set while maintaining the same log file. If either
the log directory or the log prefix has changed, then a new log file will be
created.
loggerName
- the name of the logger to be created or updated.logLevel
- the logger log level.logDirectory
- the required directory to store the logs.logPrefix
- the required file name prefix of the log
file name; the format will be
<logPrefix>-YYMMDD-hhmmss.log.formatterClassName
- a LogFormatter
class
name; if this is null or empty, the
default LogFormatter
will be
used. The customized log formatter must inherit
from org.eclipse.datatools.connectivity.oda.logging.LogFormatter
and implements the format()
method.
Logger
.public static Logger getLogger(java.lang.String loggerName)
Logger
by name. The
specified name must be the same name used in the
createLogger()
method.
loggerName
- the logger's name.
Logger
associated with the name;
null
if no Logger
is
associated with the specified name.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |