Package org.jboss.logmanager
Class LogManager
- java.lang.Object
-
- java.util.logging.LogManager
-
- org.jboss.logmanager.LogManager
-
public final class LogManager extends java.util.logging.LogManager
Simplified log manager. Designed to work around the (many) design flaws of the JDK platform log manager.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PER_THREAD_LOG_FILTER_KEY
-
Constructor Summary
Constructors Constructor Description LogManager()
Construct a new logmanager instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.logging.LogManager
addConfigurationListener(java.lang.Runnable listener)
Configuration listeners are not currently supported.boolean
addLogger(java.util.logging.Logger logger)
Do nothing.void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Do nothing.Logger
getLogger(java.lang.String name)
Get or create a logger with the given name.java.util.Enumeration<java.lang.String>
getLoggerNames()
java.lang.String
getProperty(java.lang.String name)
Does nothing.static java.util.logging.Filter
getThreadLocalLogFilter()
Returns the currently set filter for this thread ornull
if one has not been set.void
readConfiguration()
Configure the log manager one time.void
readConfiguration(java.io.InputStream inputStream)
Configure the log manager.void
removeConfigurationListener(java.lang.Runnable listener)
Configuration listeners are not currently supported.void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Do nothing.void
reset()
Does nothing.static void
setThreadLocalLogLevel(java.util.logging.Filter filter)
Sets the filter on the thread for all loggers.void
updateConfiguration(java.io.InputStream ins, java.util.function.Function<java.lang.String,java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.String>> mapper)
Does nothing.void
updateConfiguration(java.util.function.Function<java.lang.String,java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.String>> mapper)
Does nothing.
-
-
-
Field Detail
-
PER_THREAD_LOG_FILTER_KEY
public static final java.lang.String PER_THREAD_LOG_FILTER_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
readConfiguration
public void readConfiguration() throws java.io.IOException, java.lang.SecurityException
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 classjava.util.logging.LogManager
- Throws:
java.io.IOException
java.lang.SecurityException
-
readConfiguration
public void readConfiguration(java.io.InputStream inputStream) throws java.io.IOException, java.lang.SecurityException
Configure the log manager.- Overrides:
readConfiguration
in classjava.util.logging.LogManager
- Parameters:
inputStream
- the input stream from which the logmanager should be configured- Throws:
java.io.IOException
java.lang.SecurityException
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Do nothing. Properties and their listeners are not supported.- Parameters:
l
- ignored
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Do nothing. Properties and their listeners are not supported.- Parameters:
l
- ignored
-
updateConfiguration
public void updateConfiguration(java.util.function.Function<java.lang.String,java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.String>> mapper) throws java.io.IOException
Does nothing. The configuration API should be used.- Overrides:
updateConfiguration
in classjava.util.logging.LogManager
- Parameters:
mapper
- not used- Throws:
java.io.IOException
-
updateConfiguration
public void updateConfiguration(java.io.InputStream ins, java.util.function.Function<java.lang.String,java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.String>> mapper) throws java.io.IOException
Does nothing. The configuration API should be used.- Overrides:
updateConfiguration
in classjava.util.logging.LogManager
- Parameters:
ins
- not usedmapper
- not used- Throws:
java.io.IOException
-
addConfigurationListener
public java.util.logging.LogManager addConfigurationListener(java.lang.Runnable listener)
Configuration listeners are not currently supported.- Overrides:
addConfigurationListener
in classjava.util.logging.LogManager
- Parameters:
listener
- not used- Returns:
- this log manager
-
removeConfigurationListener
public void removeConfigurationListener(java.lang.Runnable listener)
Configuration listeners are not currently supported.- Overrides:
removeConfigurationListener
in classjava.util.logging.LogManager
- Parameters:
listener
- not used
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Does nothing. Properties are not supported.- Overrides:
getProperty
in classjava.util.logging.LogManager
- Parameters:
name
- ignored- Returns:
null
-
reset
public void reset()
Does nothing. This method only causes trouble.- Overrides:
reset
in classjava.util.logging.LogManager
-
getLoggerNames
public java.util.Enumeration<java.lang.String> getLoggerNames()
- Overrides:
getLoggerNames
in classjava.util.logging.LogManager
-
addLogger
public boolean addLogger(java.util.logging.Logger logger)
Do nothing. Loggers are only added/acquired viagetLogger(String)
.- Overrides:
addLogger
in classjava.util.logging.LogManager
- Parameters:
logger
- ignored- Returns:
false
-
getLogger
public Logger getLogger(java.lang.String name)
Get or create a logger with the given name.- Overrides:
getLogger
in classjava.util.logging.LogManager
- Parameters:
name
- the logger name- Returns:
- the corresponding logger
-
getThreadLocalLogFilter
public static java.util.logging.Filter 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
public static void setThreadLocalLogLevel(java.util.logging.Filter filter)
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
-
-