Package org.jboss.logmanager
Class LogManager
java.lang.Object
java.util.logging.LogManager
org.jboss.logmanager.LogManager
Simplified log manager. Designed to work around the (many) design flaws of the JDK platform log manager.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static final class
private static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBoolean
(package private) static final boolean
static final String
Fields inherited from class java.util.logging.LogManager
LOGGING_MXBEAN_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Do nothing.void
Do nothing.(package private) static <T> T
Get or create a logger with the given name.getProperty
(String name) Does nothing.static Filter
Returns the currently set filter for this thread ornull
if one has not been set.void
Configure the log manager one time.void
readConfiguration
(InputStream inputStream) Configure the log manager.void
Do nothing.void
reset()
Does nothing.static void
setThreadLocalLogLevel
(Filter filter) Sets the filter on the thread for all loggers.private static String
tryGetProperty
(String name, String defaultVal) Methods inherited from class java.util.logging.LogManager
addConfigurationListener, checkAccess, getLoggingMXBean, getLogManager, removeConfigurationListener, updateConfiguration, updateConfiguration
-
Field Details
-
PER_THREAD_LOG_FILTER_KEY
- See Also:
-
PER_THREAD_LOG_FILTER
static final boolean PER_THREAD_LOG_FILTER -
configured
-
-
Constructor Details
-
LogManager
public LogManager()Construct a new logmanager instance. Attempts to plug a known memory leak inLevel
as well.
-
-
Method Details
-
tryGetProperty
-
readConfiguration
Configure the log manager one time. An implementation ofConfigurationLocator
is created by constructing an instance of the class name specified in theorg.jboss.logmanager.configurationLocator
system property.- Overrides:
readConfiguration
in classLogManager
- Throws:
IOException
SecurityException
-
readConfiguration
Configure the log manager.- Overrides:
readConfiguration
in classLogManager
- Parameters:
inputStream
- the input stream from which the logmanager should be configured- Throws:
IOException
SecurityException
-
construct
- Throws:
IOException
-
addPropertyChangeListener
Do nothing. Properties and their listeners are not supported.- Parameters:
l
- ignored
-
removePropertyChangeListener
Do nothing. Properties and their listeners are not supported.- Parameters:
l
- ignored
-
getProperty
Does nothing. Properties are not supported.- Overrides:
getProperty
in classLogManager
- Parameters:
name
- ignored- Returns:
null
-
reset
public void reset()Does nothing. This method only causes trouble.- Overrides:
reset
in classLogManager
-
getLoggerNames
- Overrides:
getLoggerNames
in classLogManager
-
addLogger
Do nothing. Loggers are only added/acquired viagetLogger(String)
.- Overrides:
addLogger
in classLogManager
- Parameters:
logger
- ignored- Returns:
false
-
getLogger
Get or create a logger with the given name.- Overrides:
getLogger
in classLogManager
- Parameters:
name
- the logger name- Returns:
- the corresponding logger
-
getThreadLocalLogFilter
Returns the currently set filter for this thread ornull
if one has not been set.If the
PER_THREAD_LOG_FILTER_KEY
is not set totrue
thennull
will always be returned.- Returns:
- the filter set for the thread or
null
if no level was set
-
setThreadLocalLogLevel
Sets the filter on the thread for all loggers.This feature only works if the
PER_THREAD_LOG_FILTER
was set totrue
- Parameters:
filter
- the filter to set for all loggers on this thread
-