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, java.util.logging.Filter, 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
private static class

Field Summary

Modifier and TypeField and Description
private final AtomicReference<LogContextConfigurator>
pack-priv static final boolean
public static final String
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 static Filter

Returns:

the filter set for the thread or null if no level was set
getThreadLocalLogFilter
()

Returns the currently set filter for this thread or null if one has not been set.

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 static void
setThreadLocalLogLevel(final Filter
the filter to set for all loggers on this thread
filter
)

Sets the filter on the thread for all loggers.

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

Field Detail

configuratorRefback to summary
private final AtomicReference<LogContextConfigurator> configuratorRef
PER_THREAD_LOG_FILTERback to summary
pack-priv static final boolean PER_THREAD_LOG_FILTER
PER_THREAD_LOG_FILTER_KEYback to summary
public static final String PER_THREAD_LOG_FILTER_KEY

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

getThreadLocalLogFilterback to summary
public static Filter getThreadLocalLogFilter()

Returns the currently set filter for this thread or null if one has not been set.

If the PER_THREAD_LOG_FILTER_KEY is not set to true then null will always be returned.

Returns:Filter

the filter set for the thread or null if no level was set

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.

setThreadLocalLogLevelback to summary
public static void setThreadLocalLogLevel(final Filter filter)

Sets the filter on the thread for all loggers.

This feature only works if the PER_THREAD_LOG_FILTER was set to true

Parameters
filter:Filter

the filter to set for all loggers on this thread

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

private Class LogManager.LocalFilterHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final ThreadLocal<Filter>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOCAL_FILTERback to summary
pack-priv static final ThreadLocal<Filter> LOCAL_FILTER

Constructor Detail

LocalFilterHolderback to summary
private LocalFilterHolder()