java.util.logging.LogManager . Note that the system property
java.util.logging.manager must be set to org.apache.logging.log4j.jul.LogManager in order to use
this adaptor. This LogManager requires the log4j-api library to be available. If log4j-core is
also available, then more features of java.util.logging.Logger are supported.
To override the default AbstractLoggerAdapter that is used, specify the Log4j property
log4j.jul.LoggerAdapter and set it to the fully qualified class name of a custom
implementation. All implementations must have a default constructor.
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private final AbstractLoggerAdapter | |
| private final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | addLogger(final Logger
the new logger. logger)Overrides java. Add a named logger. |
| public Logger | getLogger(final String
name of the logger name)Overrides java. Method to find a named logger. |
| public Enumeration | getLoggerNames()
Overrides java. Get an enumeration of known logger names. |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| loggerAdapter | back to summary |
|---|---|
| private final AbstractLoggerAdapter loggerAdapter | |
| recursive | back to summary |
|---|---|
| private final ThreadLocal<Set<String>> recursive | |
| LogManager | back to summary |
|---|---|
| public LogManager() | |
| addLogger | back to summary |
|---|---|
| public boolean addLogger(final Logger logger) Overrides java. Doc from java. Add a named logger. This does nothing and returns false if a logger with the same name is already registered. The Logger factory methods call this method to register each newly created Logger. The application should retain its own reference to the Logger object to avoid it being garbage collected. The LogManager may only retain a weak reference. | |
| getLogger | back to summary |
|---|---|
| public Logger getLogger(final String name) Overrides java. Doc from java. Method to find a named logger.
Note that since untrusted code may create loggers with
arbitrary names this method should not be relied on to
find Loggers for security sensitive logging.
It is also important to note that the Logger associated with the
String | |
| getLoggerNames | back to summary |
|---|---|
| public Enumeration Overrides java. Doc from java. Get an enumeration of known logger names. Note Loggers may be added dynamically as new classes are loaded.
This method only reports on the loggers that are currently registered.
It is also important to note that this method only returns the name
of a Logger, not a strong reference to the Logger itself.
The returned String does nothing to prevent the Logger from being
garbage collected. In particular, if the returned name is passed
to
| |