|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectoracle.adfnmc.java.util.logging.LogManager
public class LogManager
LogManager is used to manage named Loggers and
any shared logging properties.
There is one global LogManager instance in the application,
which can be obtained by calling the static method
LogManager.getLogManager().
All methods on this type can be taken as being thread safe.
The LogManager class can be specified by the
"java.util.logging.manager" system property. If the property is unavailable
or invalid java.util.logging.LogManager will be used by
default.
On initialization, LogManager reads its configuration data
from a properties file, which by default is the "lib/logging.properties" file
in the JRE directory.
However, two system properties can be used instead to customize the
initialization of the LogManager:
These properties can be set either by using the Preferences API, as a command line option or by passing the appropriate system property definitions to JNI_CreateJavaVM.
The "java.util.logging.config.class" property should specify a class name. If
it is set, this class will be loaded and instantiated during
LogManager's initialization, so that this object's default
constructor can read the initial configuration and define properties for the
LogManager.
The "java.util.logging.config.file" system property can be used to specify a properties file if the "java.util.logging.config.class" property has not been used. This file will be read instead of the default properties file.
Some global logging properties are as follows:
Handler and must have a public
no-argument constructor. They will be registered with the root
Logger.
Besides global properties, properties for individual Loggers
and Handlers can be specified in the property files. The names
of these properties will start with the fully qualified name of the handler
or logger.
The LogManager organizes Loggers based on their
fully qualified names. For example, "x.y.z" is child of "x.y".
Levels for Loggers can be defined by properties whose name end
with ".level". For example, "alogger.level = 4" sets the level for the logger
"alogger" to 4, Any children of "alogger" will also be given the level 4
unless specified lower down in the properties file. The property ".level"
will set the log level for the root logger.
| Field Summary | |
|---|---|
static java.lang.String |
LOGGING_MXBEAN_NAME
The String value of the LoggingMXBean's ObjectName. |
| Constructor Summary | |
|---|---|
protected |
LogManager()
Default constructor. |
| Method Summary | |
|---|---|
boolean |
addLogger(Logger logger)
Add a given logger into the hierarchical namespace. |
void |
checkAccess()
Check that the caller has LoggingPermission("control") so
that it is trusted to modify the configuration for logging framework. |
Logger |
getLogger(java.lang.String name)
Get the logger with the given name |
java.util.Enumeration |
getLoggerNames()
Get a Enumeration of all registered logger names |
static LogManager |
getLogManager()
Get the global LogManager instance |
java.lang.String |
getProperty(java.lang.String name)
Get the value of property with given name |
void |
readConfiguration()
Re-initialize the properties and configuration. |
void |
reset()
Reset configuration. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LOGGING_MXBEAN_NAME
The String value of the LoggingMXBean's ObjectName.
| Constructor Detail |
|---|
protected LogManager()
LogManager instance, which can be get by
LogManager.getLogManager(. This is protected so that
application can subclass the object.
| Method Detail |
|---|
public void checkAccess()
LoggingPermission("control") so
that it is trusted to modify the configuration for logging framework. If
the check passes, just return, otherwise SecurityException
will be thrown.
java.lang.SecurityException - if there is a security manager in operation and the invoker
of this method does not have the required security permission
LoggingPermission("control")public boolean addLogger(Logger logger)
Logger.addLogger() factory methods call this method to add
newly created Logger. This returns false if a logger with the given name
has existed in the namespace
Note that the LogManager may only retain weak references
to registered loggers. In order to prevent Logger objects
from being unexpectedly garbage collected it is necessary for
applications to maintain references to them.
logger - the logger to be added
public Logger getLogger(java.lang.String name)
name - name of logger
public java.util.Enumeration getLoggerNames()
Enumeration of all registered logger names
public static LogManager getLogManager()
LogManager instance
LogManager instancepublic java.lang.String getProperty(java.lang.String name)
name - the name of property
public void readConfiguration()
throws java.io.IOException
LogManager instantiation.
A PropertyChangeEvent must be fired.
java.io.IOException - if any IO related problems happened
java.lang.SecurityException - if security manager exists and it determines that caller does
not have the required permissions to perform this actionpublic void reset()
All handlers are closed and removed from any named loggers. All loggers'
level is set to null, except the root logger's level is set to
Level.INFO.
java.lang.SecurityException - if security manager exists and it determines that caller does
not have the required permissions to perform this action
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||