See: Description
| Class | Description |
|---|---|
| ConsoleHandlerN |
A Console handler that detects duplicate logs.
|
| ContextLogManager |
Per classloader LogManager implementation.
|
| ContextLogManager.ClassLoaderLogInfo | |
| ContextLogManager.LogNode | |
| FileHandlerN | |
| IsLoggableDelegate |
A utility to plug into Handlers that want to detect duplicate logs.
|
| JULAppender |
simple bridge from Log4J to JUL.
|
| Logger |
Just a wrapper class around java.util.Logger to add specific logging methods.
|
| LogManagement |
Ths static initialization of this class should be fired early in an application by doing
|
| SocketHandlerN |
A SocketHandler that detects duplicate publications.Y
|
| StackTraceFormats | |
| StreamHandlerN |
:
A StreamHandler that detects duplicate publications.
|
| TextFormatter |
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 initialisation", 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 .
# Properties file which configures the operation of the CCS # logging facility. # The system will look for this config file, first using # a System property specified at startup: # # java -Dorg.lsst.ccs.resources.directory=myLoggingConfigFilePath # # If this property is not specified, then the config file is # retrieved from its default location at: # # GENERAL_RESOURCES_DIRECTORY/logging.properties # Global logging properties. # ------------------------------------------ # The set of handlers to be loaded upon startup. # Comma-separated list of class names. # (? LogManager docs say no comma here, but JDK example has comma.) # handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler handlers=org.lsst.ccs.utilities.logging.ConsoleHandlerN ## BEWARE: you CAN'T set org.lsst.ccs.bus.utils.LogBusHandler HERE! ## because it is initialized later (when the buses are activated) # Default global logging level. # Loggers and Handlers may override this level .level=WARNING # Loggers # ------------------------------------------ # Loggers are usually attached to packages. # Here, the level for each package is specified. # The global level is used by default, so levels # specified here simply act as an override. #myapp.ui.level=ALL #myapp.business.level=CONFIG #myapp.data.level=SEVERE org.lsst=WARNING # Handlers # ----------------------------------------- # --- ConsoleHandler --- # Override of global logging level #java.util.logging.ConsoleHandler.level=SEVERE org.lsst.ccs.utilities.logging.ConsoleHandlerN.level=WARNING ## BEWARE: you CAN'T set the Level of org.lsst.ccs.bus.utils.LogBusHandler HERE! ## because it is initialized later (when the buses are activated) ## to set this handler's level without invoking a command use property "org.lsst.ccs.logbuslevel"
Copyright © 2014 LSST. All Rights Reserved.