Package org.jboss.logging

## Interface LoggerProvider

    public interface LoggerProvider

A contract for the log provider implementation.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `clearMdc()` Removes all entries from the message diagnostics context.
`void` `clearNdc()` Clears the nested diagnostics context.
`Logger` `getLogger​(java.lang.String name)` Returns a logger which is backed by a logger from the log provider.
`java.lang.Object` `getMdc​(java.lang.String key)` Returns the value for the key on the message diagnostics context or `null` if no value was found.
`java.util.Map<java.lang.String,​java.lang.Object>` `getMdcMap()` Returns the map from the context.
`java.lang.String` `getNdc()` Retrieves the current values set for the nested diagnostics context.
`int` `getNdcDepth()` The current depth of the nested diagnostics context.
`java.lang.String` `peekNdc()` Peeks at the top value from the stack and returns it.
`java.lang.String` `popNdc()` Pops top value from the stack and returns it.
`void` `pushNdc​(java.lang.String message)` Pushes a value to the nested diagnostics context stack.
`java.lang.Object` `putMdc​(java.lang.String key, java.lang.Object value)` Puts the value onto the message diagnostics context.
`void` `removeMdc​(java.lang.String key)` Removes the value from the message diagnostics context.
`void` `setNdcMaxDepth​(int maxDepth)` Sets maximum depth of the stack removing any entries below the maximum depth.

### Method Detail

#### getLogger

    Logger getLogger​(java.lang.String name)

Returns a logger which is backed by a logger from the log provider.

Note: this should never be `null`

Parameters:
  `name` - the name of the logger
Returns:
  a logger for the log provider logger.

#### clearMdc

    void clearMdc()

Removes all entries from the message diagnostics context.

#### putMdc

    java.lang.Object putMdc​(java.lang.String key,
                            java.lang.Object value)

Puts the value onto the message diagnostics context.

Parameters:
  `key` - the key for the value
  `value` - the value
Returns:
  the previous value set or `null` if no value was set

#### getMdc

    java.lang.Object getMdc​(java.lang.String key)

Returns the value for the key on the message diagnostics context or `null` if no value was found.

Parameters:
  `key` - the key to lookup the value for
Returns:
  the value or `null` if not found

#### removeMdc

    void removeMdc​(java.lang.String key)

Removes the value from the message diagnostics context.

Parameters:
  `key` - the key of the value to remove

#### getMdcMap

    java.util.Map<java.lang.String,​java.lang.Object> getMdcMap()

Returns the map from the context.

Note that in most implementations this is an expensive operation and should be used sparingly.

Returns:
  the map from the context or an empty map if the context is `null`

#### clearNdc

    void clearNdc()

Clears the nested diagnostics context.

#### getNdc

    java.lang.String getNdc()

Retrieves the current values set for the nested diagnostics context.

Returns:
  the current value set or `null` if no value was set

#### getNdcDepth

    int getNdcDepth()

The current depth of the nested diagnostics context.

Returns:
  the current depth of the stack

#### popNdc

    java.lang.String popNdc()

Pops top value from the stack and returns it.

Returns:
  the top value from the stack or an empty string if no value was set

#### peekNdc

    java.lang.String peekNdc()

Peeks at the top value from the stack and returns it.

Returns:
  the value or an empty string

#### pushNdc

    void pushNdc​(java.lang.String message)

Pushes a value to the nested diagnostics context stack.

Parameters:
  `message` - the message to push

#### setNdcMaxDepth

    void setNdcMaxDepth​(int maxDepth)

Sets maximum depth of the stack removing any entries below the maximum depth.

Parameters:
  `maxDepth` - the maximum depth to set