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 classprivate static classprivate static final classprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBoolean(package private) static final booleanstatic final StringFields inherited from class LogManager
LOGGING_MXBEAN_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDo nothing.voidDo nothing.(package private) static <T> TGet or create a logger with the given name.getProperty(String name) Does nothing.static FilterReturns the currently set filter for this thread ornullif one has not been set.voidConfigure the log manager one time.voidreadConfiguration(InputStream inputStream) Configure the log manager.voidDo nothing.voidreset()Does nothing.static voidsetThreadLocalLogLevel(Filter filter) Sets the filter on the thread for all loggers.private static StringtryGetProperty(String name, String defaultVal) Methods inherited from class 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 inLevelas well.
-
-
Method Details
-
tryGetProperty
-
readConfiguration
Configure 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
Configure the log manager.- Overrides:
readConfigurationin classLogManager- Parameters:
inputStream- the input stream from which the logmanager should be configured- Throws:
IOExceptionSecurityException
-
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:
getPropertyin classLogManager- Parameters:
name- ignored- Returns:
null
-
reset
public void reset()Does nothing. This method only causes trouble.- Overrides:
resetin classLogManager
-
getLoggerNames
- Overrides:
getLoggerNamesin classLogManager
-
addLogger
Do nothing. Loggers are only added/acquired viagetLogger(String).- Overrides:
addLoggerin classLogManager- Parameters:
logger- ignored- Returns:
false
-
getLogger
Get or create a logger with the given name.- Overrides:
getLoggerin classLogManager- Parameters:
name- the logger name- Returns:
- the corresponding logger
-
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
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
-