|
||||||||||
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
public class 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 specified
log configuration. |
static Logger |
createLogger(java.lang.String loggerName,
int logLevel,
java.lang.String logDirectory,
java.lang.String logPrefix,
java.lang.String formatterClassName,
boolean isManaged)
Creates a named Logger with the specified log configuration. |
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 specified
log configuration. 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 under this management cannot have the same
logger name.
loggerName
- the name of the logger to be createdlogLevel
- the logger log levellogDirectory
- the required directory to store the logslogPrefix
- the required file name prefix of the log
file name; the format will be
<logPrefix>-YYMMDD-hhmmss.logformatterClassName
- 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.createLogger(String, int, String, String, String, boolean)
public static Logger createLogger(java.lang.String loggerName, int logLevel, java.lang.String logDirectory, java.lang.String logPrefix, java.lang.String formatterClassName, boolean isManaged)
Logger
with the specified log configuration.
loggerName
- the name of the logger to be createdlogLevel
- the logger log levellogDirectory
- the required directory to store the logslogPrefix
- the required file name prefix of the log
file nameformatterClassName
- a LogFormatter
class nameisManaged
- indicates whether the created logger should be managed by this;
if true, the logger name must be unique and the logger instance can be obtained
by getLogger(String)
;
if false, this does not maintain a reference to the created logger
Logger
java.lang.IllegalArgumentException
- if logger is to be managed and the same name already exists.createLogger(String, int, String, String, String)
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 |