|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.util.logging.BeamLogManager
public class BeamLogManager
This class is the central manager class for logging. It exposes a set of convenience methods for the initializytion and configuration of the logging framework.
| Constructor Summary | |
|---|---|
BeamLogManager()
|
|
| Method Summary | |
|---|---|
static void |
configureSystemLogger(Formatter formatter,
boolean consoleEcho)
Configures the system logger using the given formatter and installs an optional console handler. |
static BeamFormatter |
createFormatter(String appName,
String appVersion,
String copyrightInfo)
Crates a logging formatter. |
static String |
createLogHeader(String appName,
String appVersion,
String copyrightInfo)
|
static void |
ensureLogPathFromPatternExists(String logPattern)
|
static String |
getLogFilePattern(File outDir,
String logFilenamePrefix)
Gets a log file pattern for the specified output directory filname prefix. |
static String |
getLogFilePattern(String logFilenamePrefix)
Gets a log file pattern for the given filname prefix. |
static CacheHandler |
getRegisteredCacheHandler()
Retrieves the first registered CacheHandler in the list of handlers attached to the system logger. |
static Logger |
getSystemLogger()
Gets the system logger determined by the name returned by the getSystemLoggerName method. |
static String |
getSystemLoggerName()
Gets the name of the system logger. |
static void |
removeRootLoggerHandlers()
Removes all logging handlers from the root logger. |
static void |
setSystemLoggerName(String systemLoggerName)
Sets the name of the system logger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeamLogManager()
| Method Detail |
|---|
public static String getSystemLoggerName()
"beam.". High-level application
classes should always use loggers with the name "beam.app-name".
nullsetSystemLoggerName(java.lang.String),
getSystemLogger()public static void setSystemLoggerName(String systemLoggerName)
"beam.".
systemLoggerName - the name of the system logger, must not be nullgetSystemLoggerName(),
getSystemLogger()public static Logger getSystemLogger()
getSystemLoggerName method. Other
loggers are obtained using the standard Java 1.4 method java.util.logging.Logger.getLogger(name).
BEAM logging works as follows:
getSystemLoggerName(),
setSystemLoggerName(java.lang.String)public static String getLogFilePattern(String logFilenamePrefix)
$BEAM_INSTALL_DIR$/log and a filename created from the given log
filename prefix. This pattern is used to create java.util.logging.FileHandler instances.
logFilenamePrefix - the log filename prefix
getLogFilePattern(File, String)
public static String getLogFilePattern(File outDir,
String logFilenamePrefix)
java.util.logging.FileHandler instances.
logFilenamePrefix - the log filename prefix
getLogFilePattern(String)
public static void configureSystemLogger(Formatter formatter,
boolean consoleEcho)
formatter - the formatter to be usedconsoleEcho - if true, a console handler will be installedpublic static CacheHandler getRegisteredCacheHandler()
public static BeamFormatter createFormatter(String appName,
String appVersion,
String copyrightInfo)
appName - the application nameappVersion - the application version stringcopyrightInfo - the application copyright information
public static void removeRootLoggerHandlers()
public static void ensureLogPathFromPatternExists(String logPattern)
public static String createLogHeader(String appName,
String appVersion,
String copyrightInfo)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||