Package org.jboss.logmanager
Class LogManager
- java.lang.Object
-
- java.util.logging.LogManager
-
- org.jboss.logmanager.LogManager
-
public final class LogManager extends 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 StringPER_THREAD_LOG_FILTER_KEY-
Fields inherited from class java.util.logging.LogManager
LOGGING_MXBEAN_NAME
-
-
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 booleanaddLogger(Logger logger)Do nothing.voidaddPropertyChangeListener(PropertyChangeListener l)Do nothing.LoggergetLogger(String name)Get or create a logger with the given name.Enumeration<String>getLoggerNames()StringgetProperty(String name)Does nothing.static FiltergetThreadLocalLogFilter()Returns the currently set filter for this thread ornullif one has not been set.voidreadConfiguration()Configure the log manager one time.voidreadConfiguration(InputStream inputStream)Configure the log manager.voidremovePropertyChangeListener(PropertyChangeListener l)Do nothing.voidreset()Does nothing.static voidsetThreadLocalLogLevel(Filter filter)Sets the filter on the thread for all loggers.-
Methods inherited from class java.util.logging.LogManager
addConfigurationListener, checkAccess, getLoggingMXBean, getLogManager, removeConfigurationListener, updateConfiguration, updateConfiguration
-
-
-
-
Field Detail
-
PER_THREAD_LOG_FILTER_KEY
public static final String PER_THREAD_LOG_FILTER_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogManager
public LogManager()
Construct a new logmanager instance. Attempts to plug a known memory leak inLevelas well.
-
-
Method Detail
-
readConfiguration
public void readConfiguration() throws IOException, 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 classLogManager- Throws:
IOExceptionSecurityException
-
readConfiguration
public void readConfiguration(InputStream inputStream) throws IOException, SecurityException
Configure the log manager.- Overrides:
readConfigurationin classLogManager- Parameters:
inputStream- the input stream from which the logmanager should be configured- Throws:
IOExceptionSecurityException
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
Do nothing. Properties and their listeners are not supported.- Parameters:
l- ignored
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Do nothing. Properties and their listeners are not supported.- Parameters:
l- ignored
-
getProperty
public String getProperty(String name)
Does nothing. Properties are not supported.- Overrides:
getPropertyin classLogManager- Parameters:
name- ignored- Returns:
null
-
reset
public void reset()
Does nothing. This method only causes trouble.- Overrides:
resetin classLogManager
-
getLoggerNames
public Enumeration<String> getLoggerNames()
- Overrides:
getLoggerNamesin classLogManager
-
addLogger
public boolean addLogger(Logger logger)
Do nothing. Loggers are only added/acquired viagetLogger(String).- Overrides:
addLoggerin classLogManager- Parameters:
logger- ignored- Returns:
false
-
getLogger
public Logger getLogger(String name)
Get or create a logger with the given name.- Overrides:
getLoggerin classLogManager- Parameters:
name- the logger name- Returns:
- the corresponding logger
-
getThreadLocalLogFilter
public static 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(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
-
-