Top Description Methods
org.jboss.logging

public Interface LoggerProvider

Known Direct Implementers
org.jboss.logging.Slf4jLoggerProvider, org.jboss.logging.JBossLogManagerProvider, org.jboss.logging.JDKLoggerProvider, org.jboss.logging.Log4j2LoggerProvider, org.jboss.logging.Log4jLoggerProvider
Imports
java.util.Collections, .Map

A contract for the log provider implementation.

Method Summary

Modifier and TypeMethod and Description
public void
clearMdc()

Removes all entries from the message diagnostics context.

public void
clearNdc()

Clears the nested diagnostics context.

public Logger

Returns:

a logger for the log provider logger.
getLogger
(String
the name of the logger
name
)

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

public Object

Returns:

the value or null if not found
getMdc
(String
the key to lookup the value for
key
)

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

public Map<String, Object>

Returns:

the map from the context or an empty map if the context is null
getMdcMap
()

Returns the map from the context.

public String

Returns:

the current value set or null if no value was set
getNdc
()

Retrieves the current values set for the nested diagnostics context.

public int

Returns:

the current depth of the stack
getNdcDepth
()

The current depth of the nested diagnostics context.

public String

Returns:

the value or an empty string
peekNdc
()

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

public String

Returns:

the top value from the stack or an empty string if no value was set
popNdc
()

Pops top value from the stack and returns it.

public void
pushNdc(String
the message to push
message
)

Pushes a value to the nested diagnostics context stack.

public Object

Returns:

the previous value set or null if no value was set
putMdc
(String
the key for the value
key
,
Object
the value
value
)

Puts the value onto the message diagnostics context.

public void
removeMdc(String
the key of the value to remove
key
)

Removes the value from the message diagnostics context.

public void
setNdcMaxDepth(int
the maximum depth to set
maxDepth
)

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

Method Detail

clearMdcback to summary
public void clearMdc()

Removes all entries from the message diagnostics context.

clearNdcback to summary
public void clearNdc()

Clears the nested diagnostics context.

getLoggerback to summary
public Logger getLogger(String name)

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

Note

this should never be null

Parameters
name:String

the name of the logger

Returns:Logger

a logger for the log provider logger.

getMdcback to summary
public Object getMdc(String key)

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

Parameters
key:String

the key to lookup the value for

Returns:Object

the value or null if not found

getMdcMapback to summary
public Map<String, Object> getMdcMap()

Returns the map from the context.

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

Returns:Map<String, Object>

the map from the context or an empty map if the context is null

getNdcback to summary
public String getNdc()

Retrieves the current values set for the nested diagnostics context.

Returns:String

the current value set or null if no value was set

getNdcDepthback to summary
public int getNdcDepth()

The current depth of the nested diagnostics context.

Returns:int

the current depth of the stack

peekNdcback to summary
public String peekNdc()

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

Returns:String

the value or an empty string

popNdcback to summary
public String popNdc()

Pops top value from the stack and returns it.

Returns:String

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

pushNdcback to summary
public void pushNdc(String message)

Pushes a value to the nested diagnostics context stack.

Parameters
message:String

the message to push

putMdcback to summary
public Object putMdc(String key, Object value)

Puts the value onto the message diagnostics context.

Parameters
key:String

the key for the value

value:Object

the value

Returns:Object

the previous value set or null if no value was set

removeMdcback to summary
public void removeMdc(String key)

Removes the value from the message diagnostics context.

Parameters
key:String

the key of the value to remove

setNdcMaxDepthback to summary
public void setNdcMaxDepth(int maxDepth)

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

Parameters
maxDepth:int

the maximum depth to set