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 final String`
`PER_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

Modifier and Type
Method
Description
`LogManager`
`addConfigurationListener(Runnable listener)`
Configuration listeners are not currently supported.
`boolean`
`addLogger(Logger logger)`
Do nothing.
`void`
`addPropertyChangeListener(PropertyChangeListener l)`
Do nothing.
`Logger`
`getLogger(String name)`
Get or create a logger with the given name.
`Enumeration<String>`
`getLoggerNames()`
`String`
`getProperty(String name)`
Does nothing.
`static Filter`
`getThreadLocalLogFilter()`
Returns the currently set filter for this thread or `null` if one has not been set.
`void`
`readConfiguration()`
Configure the log manager one time.
`void`
`readConfiguration(InputStream inputStream)`
Configure the log manager.
`void`
`removeConfigurationListener(Runnable listener)`
Configuration listeners are not currently supported.
`void`
`removePropertyChangeListener(PropertyChangeListener l)`
Do nothing.
`void`
`reset()`
Does nothing.
`static void`
`setThreadLocalLogLevel(Filter filter)`
Sets the filter on the thread for all loggers.
`void`
`updateConfiguration(InputStream ins, Function<String,BiFunction<String,String,String>> mapper)`
Does nothing.
`void`
`updateConfiguration(Function<String,BiFunction<String,String,String>> mapper)`
Does nothing.

### Methods inherited from class java.util.logging.LogManager

`checkAccess, getLoggingMXBean, getLogManager`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PER_THREAD_LOG_FILTER_KEY

public static final String PER_THREAD_LOG_FILTER_KEY

See Also:
  - Constant Field Values

## Constructor Details

### LogManager

public LogManager()
Construct a new logmanager instance. Attempts to plug a known memory leak in `Level` as well.

## Method Details

### readConfiguration

public void readConfiguration() throws IOException, SecurityException
Configure the log manager one time. An implementation of `ConfigurationLocator` is created by constructing an instance of the class name specified in the `org.jboss.logmanager.configurationLocator` system property.

Overrides:
  `readConfiguration` in class `LogManager`
Throws:
  `IOException`
  `SecurityException`

### readConfiguration

public void readConfiguration(InputStream inputStream) throws IOException, SecurityException
Configure the log manager.

Overrides:
  `readConfiguration` in class `LogManager`
Parameters:
  `inputStream` - the input stream from which the logmanager should be configured
Throws:
  `IOException`
  `SecurityException`

### 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

### updateConfiguration

public void updateConfiguration(Function<String,BiFunction<String,String,String>> mapper) throws IOException
Does nothing. The configuration API should be used.

Overrides:
  `updateConfiguration` in class `LogManager`
Parameters:
  `mapper` - not used
Throws:
  `IOException`

### updateConfiguration

public void updateConfiguration(InputStream ins, Function<String,BiFunction<String,String,String>> mapper) throws IOException
Does nothing. The configuration API should be used.

Overrides:
  `updateConfiguration` in class `LogManager`
Parameters:
  `ins` - not used
  `mapper` - not used
Throws:
  `IOException`

### addConfigurationListener

public LogManager addConfigurationListener(Runnable listener)
Configuration listeners are not currently supported.

Overrides:
  `addConfigurationListener` in class `LogManager`
Parameters:
  `listener` - not used
Returns:
  this log manager

### removeConfigurationListener

public void removeConfigurationListener(Runnable listener)
Configuration listeners are not currently supported.

Overrides:
  `removeConfigurationListener` in class `LogManager`
Parameters:
  `listener` - not used

### getProperty

public String getProperty(String name)
Does nothing. Properties are not supported.

Overrides:
  `getProperty` in class `LogManager`
Parameters:
  `name` - ignored
Returns:
  `null`

### reset

public void reset()
Does nothing. This method only causes trouble.

Overrides:
  `reset` in class `LogManager`

### getLoggerNames

public Enumeration<String> getLoggerNames()

Overrides:
  `getLoggerNames` in class `LogManager`

### addLogger

public boolean addLogger(Logger logger)
Do nothing. Loggers are only added/acquired via `getLogger(String)`.

Overrides:
  `addLogger` in class `LogManager`
Parameters:
  `logger` - ignored
Returns:
  `false`

### getLogger

public Logger getLogger(String name)
Get or create a logger with the given name.

Overrides:
  `getLogger` in class `LogManager`
Parameters:
  `name` - the logger name
Returns:
  the corresponding logger

### getThreadLocalLogFilter

public static Filter getThreadLocalLogFilter()
Returns the currently set filter for this thread or `null` if one has not been set.

If the `PER_THREAD_LOG_FILTER_KEY` is not set to `true` then `null` will always be returned.

Returns:
  the filter set for the thread or `null` if 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_FILTER` was set to `true`

Parameters:
  `filter` - the filter to set for all loggers on this thread