See: Description
| Class | Description |
|---|---|
| CCSLogManager |
A dedicated LockManager class to control the resetting of the LogManager when
a sigterm signal is received.
|
| JULAppender |
simple bridge from Log4J to JUL.
|
| Log4JConfiguration |
Utility class to provide Log4j configuration.
|
| Logger |
Just a wrapper class around java.util.Logger to add specific logging methods.
|
| LogPropertiesLoader |
The role of this class is:
to read the logging.properties and offer other codes (namely handlers) access
to the properties described (a thing not permitted by the standard logManager)
to be sure that the Handlers are lazily loaded (the standard LogManager may
not be able to load the Handlers class due to ClassLoading problems)
to delegate informations to the LogManager so it can behave properly (e.g.
|
| StackTraceFormats |
manages formatting of stackTrace.
|
| TextFormatter |
A simple text formatter.
|
| UserConsoleFilter |
Filter that discards logs which level smaller than
Level.WARNING and
coming from loggers other than "org.lsst.ccs.subsystem" or "org.lsst.ccs.driver". |
Logger logger = Logger.getLogger("org.lsst.ccs.mypackage") ;
//....
logger.info("doing the right thing!") ;
//...
if( logger.isInfoEnabled() ) {
logger.log(Level.INFO, "still better", methodCall()) ;
}
//...
try {
//...
} catch(Exception exc) {
logger.error("Oops!", exc) ;
}
But the Logger class is not only to get syntactic sugar: it provides access to "multi-dimensional logging".
What's that?
The idea is that can log the same call to different loggers in a single invocation.
So, for instance, you have the usual logger linked to a package but you want also to address different "concerns" that
are common to different classes or package. Then you can write:
logger.log(Level.INFO, "Object being initialized", theObject, "INIT");
this means that the created LogRecord will be submitted to the current Logger
and also to another one named "INIT".
logger.log(Level.INFO, "Object being moved at initialization", theObject, "INIT", "MOVE");
Then you can set the level for the corresponding package to SEVERE and set the level
of the "INIT" concern to INFO .
Copyright © 2018 LSST. All rights reserved.