Top Description Inners Fields Constructors Methods
org.jboss.logmanager

public final Class LogManager

extends LogManager
Class Inheritance
Imports
java.io.IOException, .InputStream, java.security.AccessController, .PrivilegedAction, java.util.ArrayList, .Enumeration, .Iterator, .List, .ServiceConfigurationError, .ServiceLoader, java.util.concurrent.atomic.AtomicReference, java.util.function.BiFunction, .Function, org.jboss.logmanager.configuration.PropertyLogContextConfigurator, io.smallrye.common.constraint.Assert

Simplified log manager. Designed to work around the (many) design flaws of the JDK platform log manager.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final AtomicReference<LogContextConfigurator>
Inherited from java.util.logging.LogManager:
LOGGING_MXBEAN_NAME

Constructor Summary

AccessConstructor and Description
public
LogManager()

Construct a new logmanager instance.

Method Summary

Modifier and TypeMethod and Description
public LogManager

Returns:

this log manager
addConfigurationListener
(final Runnable
not used
listener
)

Overrides java.util.logging.LogManager.addConfigurationListener.

Configuration listeners are not currently supported.

public boolean

Returns:

false
addLogger
(Logger
ignored
logger
)

Overrides java.util.logging.LogManager.addLogger.

Do nothing.

private void
doConfigure(InputStream inputStream)

public Logger

Returns:

the corresponding logger
getLogger
(String
the logger name
name
)

Overrides java.util.logging.LogManager.getLogger.

Get or create a logger with the given name.

public Enumeration<String>
getLoggerNames()

Overrides java.util.logging.LogManager.getLoggerNames.

Get an enumeration of known logger names.

public String

Returns:

null
getProperty
(String
ignored
name
)

Overrides java.util.logging.LogManager.getProperty.

Does nothing.

public void
readConfiguration()

Overrides java.util.logging.LogManager.readConfiguration.

Configure the system log context initially.

public void
readConfiguration(InputStream
ignored
inputStream
)

Overrides java.util.logging.LogManager.readConfiguration.

Configure the system log context initially withe given input stream.

public void
removeConfigurationListener(final Runnable
not used
listener
)

Overrides java.util.logging.LogManager.removeConfigurationListener.

Configuration listeners are not currently supported.

public void
reset()

Overrides java.util.logging.LogManager.reset.

Does nothing.

public void
public void
Inherited from java.util.logging.LogManager:
checkAccessgetLoggingMXBeangetLogManager

Field Detail

configuratorRefback to summary
private final AtomicReference<LogContextConfigurator> configuratorRef

Constructor Detail

LogManagerback to summary
public LogManager()

Construct a new logmanager instance. Attempts to plug a known memory leak in java.util.logging.Level as well.

Method Detail

addConfigurationListenerback to summary
public LogManager addConfigurationListener(final Runnable listener)

Overrides java.util.logging.LogManager.addConfigurationListener.

Configuration listeners are not currently supported.

Parameters
listener:Runnable

not used

Returns:LogManager

this log manager

addLoggerback to summary
public boolean addLogger(Logger logger)

Overrides java.util.logging.LogManager.addLogger.

Do nothing. Loggers are only added/acquired via getLogger(String).

Parameters
logger:Logger

ignored

Returns:boolean

false

doConfigureback to summary
private void doConfigure(InputStream inputStream)
getLoggerback to summary
public Logger getLogger(String name)

Overrides java.util.logging.LogManager.getLogger.

Get or create a logger with the given name.

Parameters
name:String

the logger name

Returns:Logger

the corresponding logger

getLoggerNamesback to summary
public Enumeration<String> getLoggerNames()

Overrides java.util.logging.LogManager.getLoggerNames.

Doc from java.util.logging.LogManager.getLoggerNames.

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 LogManager.getLogger(), then the caller must check the return value from LogManager.getLogger() for null to properly handle the case where the Logger has been garbage collected in the time since its name was returned by this method.

Returns:Enumeration<String>

enumeration of logger name strings

Annotations
@Override
getPropertyback to summary
public String getProperty(String name)

Overrides java.util.logging.LogManager.getProperty.

Does nothing. Properties are not supported.

Parameters
name:String

ignored

Returns:String

null

readConfigurationback to summary
public void readConfiguration()

Overrides java.util.logging.LogManager.readConfiguration.

Configure the system log context initially.

readConfigurationback to summary
public void readConfiguration(InputStream inputStream)

Overrides java.util.logging.LogManager.readConfiguration.

Configure the system log context initially withe given input stream.

Parameters
inputStream:InputStream

ignored

removeConfigurationListenerback to summary
public void removeConfigurationListener(final Runnable listener)

Overrides java.util.logging.LogManager.removeConfigurationListener.

Configuration listeners are not currently supported.

Parameters
listener:Runnable

not used

resetback to summary
public void reset()

Overrides java.util.logging.LogManager.reset.

Does nothing. This method only causes trouble.

updateConfigurationback to summary
public void updateConfiguration(final Function<String, BiFunction<String, String, String>> mapper) throws IOException

Overrides java.util.logging.LogManager.updateConfiguration.

Does nothing.

Parameters
mapper:Function<String, BiFunction<String, String, String>>

not used

Exceptions
IOException:

Doc from java.util.logging.LogManager.updateConfiguration.

if there are problems reading from the logging configuration file.

updateConfigurationback to summary
public void updateConfiguration(final InputStream ins, final Function<String, BiFunction<String, String, String>> mapper) throws IOException

Overrides java.util.logging.LogManager.updateConfiguration.

Does nothing.

Parameters
ins:InputStream

not used

mapper:Function<String, BiFunction<String, String, String>>

not used

Exceptions
IOException:

Doc from java.util.logging.LogManager.updateConfiguration.

if there are problems reading from the stream, or the given stream is not in the properties file format.

org.jboss.logmanager back to summary

public final Class LogManager.Provider

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static LogManager

Returns:

the log manager instance (not null)
provider
()

The service provider method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Providerback to summary
public Provider()

Method Detail

providerback to summary
public static LogManager provider()

The service provider method. This method is used when the log manager service is loaded from a modular application.

Returns:LogManager

the log manager instance (not null)

Exceptions
ClassCastException:
if the log manager is not initialized to this class