Top Description Constructors Methods
org.jboss.logging

public final Class Slf4jLoggerProvider

extends AbstractLoggerProvider
implements LoggerProvider
Class Inheritance
All Implemented Interfaces
org.jboss.logging.LoggerProvider
Imports
java.util.Collections, .LinkedHashMap, .Map, org.slf4j.LoggerFactory, .MDC, org.slf4j.spi.LocationAwareLogger

An implementation of the log provider for slf4j with Logback as the log manager.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clearMdc()

Implements org.jboss.logging.LoggerProvider.clearMdc.

Removes all entries from the message diagnostics context.

public Logger
getLogger(final String
the name of the logger
name
)

Implements org.jboss.logging.LoggerProvider.getLogger.

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

public Object
getMdc(final String
the key to lookup the value for
key
)

Implements org.jboss.logging.LoggerProvider.getMdc.

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

public Map<String, Object>
getMdcMap()

Implements org.jboss.logging.LoggerProvider.getMdcMap.

Returns the map from the context.

public Object
putMdc(final String
the key for the value
key
,
final Object
the value
value
)

Implements org.jboss.logging.LoggerProvider.putMdc.

Puts the value onto the message diagnostics context.

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

Implements org.jboss.logging.LoggerProvider.removeMdc.

Removes the value from the message diagnostics context.

Inherited from org.jboss.logging.AbstractLoggerProvider:
clearNdcgetNdcgetNdcDepthpeekNdcpopNdcpushNdcsetNdcMaxDepth

Constructor Detail

Slf4jLoggerProviderback to summary
public Slf4jLoggerProvider()

Method Detail

clearMdcback to summary
public void clearMdc()

Implements org.jboss.logging.LoggerProvider.clearMdc.

Doc from org.jboss.logging.LoggerProvider.clearMdc.

Removes all entries from the message diagnostics context.

Annotations
@Override
getLoggerback to summary
public Logger getLogger(final String name)

Implements org.jboss.logging.LoggerProvider.getLogger.

Doc from org.jboss.logging.LoggerProvider.getLogger.

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.

Annotations
@Override
getMdcback to summary
public Object getMdc(final String key)

Implements org.jboss.logging.LoggerProvider.getMdc.

Doc from org.jboss.logging.LoggerProvider.getMdc.

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

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

Implements org.jboss.logging.LoggerProvider.getMdcMap.

Doc from org.jboss.logging.LoggerProvider.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

Annotations
@Override
putMdcback to summary
public Object putMdc(final String key, final Object value)

Implements org.jboss.logging.LoggerProvider.putMdc.

Doc from org.jboss.logging.LoggerProvider.putMdc.

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

Annotations
@Override
removeMdcback to summary
public void removeMdc(final String key)

Implements org.jboss.logging.LoggerProvider.removeMdc.

Doc from org.jboss.logging.LoggerProvider.removeMdc.

Removes the value from the message diagnostics context.

Parameters
key:String

the key of the value to remove

Annotations
@Override