Top Description Fields Constructors Methods
org.slf4j.helpers

pack-priv abstract Class NamedLoggerBase

extends Object
implements Logger, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.slf4j.Logger
Known Direct Subclasses
org.slf4j.helpers.NOPLogger, org.slf4j.helpers.MarkerIgnoringBase
Imports
java.io.ObjectStreamException, .Serializable, org.slf4j.Logger, .LoggerFactory

Serves as base class for named logger implementation. More significantly, this class establishes deserialization behavior.
Author
Ceki Gulcu
Since
1.5.3
See Also
readResolve

Field Summary

Modifier and TypeField and Description
protected String
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
getName()

Implements org.slf4j.Logger.getName.

Return the name of this Logger instance.

protected Object

Returns:

logger with same name as returned by LoggerFactory
readResolve
()

Replace this instance with a homonymous (same name) logger returned by LoggerFactory.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
protected String name
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

NamedLoggerBaseback to summary
pack-priv NamedLoggerBase()

Method Detail

getNameback to summary
public String getName()

Implements org.slf4j.Logger.getName.

Doc from org.slf4j.Logger.getName.

Return the name of this Logger instance.

readResolveback to summary
protected Object readResolve() throws ObjectStreamException

Replace this instance with a homonymous (same name) logger returned by LoggerFactory. Note that this method is only called during deserialization.

This approach will work well if the desired ILoggerFactory is the one referenced by LoggerFactory. However, if the user manages its logger hierarchy through a different (non-static) mechanism, e.g. dependency injection, then this approach would be mostly counterproductive.

Returns:Object

logger with same name as returned by LoggerFactory