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.LogManagerSimplified 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.StringPER_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.LogManageraddConfigurationListener(java.lang.Runnable listener)Configuration listeners are not currently supported.booleanaddLogger(java.util.logging.Logger logger)Do nothing.voidaddPropertyChangeListener(java.beans.PropertyChangeListener l)Do nothing.LoggergetLogger(java.lang.String name)Get or create a logger with the given name.java.util.Enumeration<java.lang.String>getLoggerNames()java.lang.StringgetProperty(java.lang.String name)Does nothing.static java.util.logging.FiltergetThreadLocalLogFilter()Returns the currently set filter for this thread ornullif one has not been set.voidreadConfiguration()Configure the log manager one time.voidreadConfiguration(java.io.InputStream inputStream)Configure the log manager.voidremoveConfigurationListener(java.lang.Runnable listener)Configuration listeners are not currently supported.voidremovePropertyChangeListener(java.beans.PropertyChangeListener l)Do nothing.voidreset()Does nothing.static voidsetThreadLocalLogLevel(java.util.logging.Filter filter)Sets the filter on the thread for all loggers.voidupdateConfiguration(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.voidupdateConfiguration(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.SecurityExceptionConfigure the log manager one time. An implementation ofConfigurationLocatoris created by constructing an instance of the class name specified in theorg.jboss.logmanager.configurationLocatorsystem property.- Overrides:
readConfigurationin classjava.util.logging.LogManager- Throws:
java.io.IOExceptionjava.lang.SecurityException
-
readConfiguration
public void readConfiguration(java.io.InputStream inputStream) throws java.io.IOException, java.lang.SecurityExceptionConfigure the log manager.- Overrides:
readConfigurationin classjava.util.logging.LogManager- Parameters:
inputStream- the input stream from which the logmanager should be configured- Throws:
java.io.IOExceptionjava.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.IOExceptionDoes nothing. The configuration API should be used.- Overrides:
updateConfigurationin 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.IOExceptionDoes nothing. The configuration API should be used.- Overrides:
updateConfigurationin 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:
addConfigurationListenerin 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:
removeConfigurationListenerin 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:
getPropertyin classjava.util.logging.LogManager- Parameters:
name- ignored- Returns:
null
-
reset
public void reset()
Does nothing. This method only causes trouble.- Overrides:
resetin classjava.util.logging.LogManager
-
getLoggerNames
public java.util.Enumeration<java.lang.String> getLoggerNames()
- Overrides:
getLoggerNamesin classjava.util.logging.LogManager
-
addLogger
public boolean addLogger(java.util.logging.Logger logger)
Do nothing. Loggers are only added/acquired viagetLogger(String).- Overrides:
addLoggerin 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:
getLoggerin 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 ornullif one has not been set.If the
PER_THREAD_LOG_FILTER_KEYis not set totruethennullwill always be returned.- Returns:
- the filter set for the thread or
nullif 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_FILTERwas set totrue- Parameters:
filter- the filter to set for all loggers on this thread
-
-