Top Description Fields Methods
org.jboss.logmanager

public Interface LogContextInitializer

Imports
java.util.logging.Handler, .Level

An initializer for log contexts. The initializer provides initial values for log instances within the context for properties like levels, handlers, and so on.

The initial log context will be configured using a context initializer that is located via the JDK SPI mechanism.

This interface is intended to be forward-extensible. If new methods are added, they will include a default implementation. Implementations of this interface should accommodate the possibility of new methods being added; as a matter of convention, such methods should begin with the prefix getInitial, which will minimize the possibility of conflict.

Field Summary

Modifier and TypeField and Description
public static final LogContextInitializer
DEFAULT

The default log context initializer, which is used when none is specified.

public static final Handler[]
NO_HANDLERS

An array containing zero handlers.

Method Summary

Modifier and TypeMethod and Description
public default Handler[]

Returns:

the handlers to use (should not be null)
getInitialHandlers
(String
the logger name (must not be null)
loggerName
)

Get the initial set of handlers to configure for the given logger name.

public default Level

Returns:

the level to use, or null to inherit the level from the parent
getInitialLevel
(String
the logger name (must not be null)
loggerName
)

Get the initial level for the given logger name.

public default Level

Returns:

the level to use, or null to inherit the level from the parent
getMinimumLevel
(String
the logger name (must not be null)
loggerName
)

Get the minimum (most verbose) level allowed for the given logger name.

public default boolean

Returns:

true to use strong references, or false to use weak references
useStrongReferences
()

Establish whether strong references should be used for logger nodes.

Field Detail

DEFAULTback to summary
public static final LogContextInitializer DEFAULT

The default log context initializer, which is used when none is specified. This instance uses only default implementations for all the given methods.

NO_HANDLERSback to summary
public static final Handler[] NO_HANDLERS

An array containing zero handlers.

Method Detail

getInitialHandlersback to summary
public default Handler[] getInitialHandlers(String loggerName)

Get the initial set of handlers to configure for the given logger name.

The default implementation returns NO_HANDLERS. A value of null is considered to be the same as NO_HANDLERS.

Parameters
loggerName:String

the logger name (must not be null)

Returns:Handler[]

the handlers to use (should not be null)

getInitialLevelback to summary
public default Level getInitialLevel(String loggerName)

Get the initial level for the given logger name. If the initializer returns a null level for the root logger, then a level of INFO will be used.

The default implementation returns null.

Parameters
loggerName:String

the logger name (must not be null)

Returns:Level

the level to use, or null to inherit the level from the parent

getMinimumLevelback to summary
public default Level getMinimumLevel(String loggerName)

Get the minimum (most verbose) level allowed for the given logger name. If the initializer returns a null level for the root logger, then a level of ALL will be used.

The default implementation returns null.

Parameters
loggerName:String

the logger name (must not be null)

Returns:Level

the level to use, or null to inherit the level from the parent

useStrongReferencesback to summary
public default boolean useStrongReferences()

Establish whether strong references should be used for logger nodes.

Returns:boolean

true to use strong references, or false to use weak references