Top Description Fields Constructors Methods
org.apache.logging.log4j.simple

public Class SimpleLoggerContextFactory

extends Object
implements LoggerContextFactory
Class Inheritance
All Implemented Interfaces
org.apache.logging.log4j.spi.LoggerContextFactory
Imports
java.net.URI, org.apache.logging.log4j.spi.LoggerContext, .LoggerContextFactory

Simple and stateless LoggerContextFactory.

Field Summary

Modifier and TypeField and Description
public static final SimpleLoggerContextFactory
INSTANCE

Singleton instance.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public LoggerContext
getContext(final String
The fully qualified class name of the caller.
fqcn
,
final ClassLoader
The ClassLoader to use or null.
loader
,
final Object
An external context (such as a ServletContext) to be associated with the LoggerContext.
externalContext
,
final boolean
If true returns the current Context, if false returns the Context appropriate for the caller if a more appropriate Context can be determined.
currentContext
)

Implements org.apache.logging.log4j.spi.LoggerContextFactory.getContext.

Creates a LoggerContext.

public LoggerContext
getContext(final String
The fully qualified class name of the caller.
fqcn
,
final ClassLoader
The ClassLoader to use or null.
loader
,
final Object
An external context (such as a ServletContext) to be associated with the LoggerContext.
externalContext
,
final boolean
If true returns the current Context, if false returns the Context appropriate for the caller if a more appropriate Context can be determined.
currentContext
,
final URI
The location of the configuration for the LoggerContext.
configLocation
,
final String
The name of the context or null.
name
)

Implements org.apache.logging.log4j.spi.LoggerContextFactory.getContext.

Creates a LoggerContext.

public boolean
isClassLoaderDependent()

Overrides default org.apache.logging.log4j.spi.LoggerContextFactory.isClassLoaderDependent.

Determines whether or not this factory and perhaps the underlying ContextSelector behavior depend on the callers classloader.

public void
removeContext(final LoggerContext
The context to remove.
removeContext
)

Implements org.apache.logging.log4j.spi.LoggerContextFactory.removeContext.

Removes knowledge of a LoggerContext.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final SimpleLoggerContextFactory INSTANCE

Singleton instance.

Constructor Detail

SimpleLoggerContextFactoryback to summary
public SimpleLoggerContextFactory()

Method Detail

getContextback to summary
public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext, final boolean currentContext)

Implements org.apache.logging.log4j.spi.LoggerContextFactory.getContext.

Doc from org.apache.logging.log4j.spi.LoggerContextFactory.getContext.

Creates a LoggerContext.

Parameters
fqcn:String

The fully qualified class name of the caller.

loader:ClassLoader

The ClassLoader to use or null.

externalContext:Object

An external context (such as a ServletContext) to be associated with the LoggerContext.

currentContext:boolean

If true returns the current Context, if false returns the Context appropriate for the caller if a more appropriate Context can be determined.

Returns:LoggerContext

The LoggerContext.

Annotations
@Override
getContextback to summary
public LoggerContext getContext(final String fqcn, final ClassLoader loader, final Object externalContext, final boolean currentContext, final URI configLocation, final String name)

Implements org.apache.logging.log4j.spi.LoggerContextFactory.getContext.

Doc from org.apache.logging.log4j.spi.LoggerContextFactory.getContext.

Creates a LoggerContext.

Parameters
fqcn:String

The fully qualified class name of the caller.

loader:ClassLoader

The ClassLoader to use or null.

externalContext:Object

An external context (such as a ServletContext) to be associated with the LoggerContext.

currentContext:boolean

If true returns the current Context, if false returns the Context appropriate for the caller if a more appropriate Context can be determined.

configLocation:URI

The location of the configuration for the LoggerContext.

name:String

The name of the context or null.

Returns:LoggerContext

The LoggerContext.

Annotations
@Override
isClassLoaderDependentback to summary
public boolean isClassLoaderDependent()

Overrides default org.apache.logging.log4j.spi.LoggerContextFactory.isClassLoaderDependent.

Doc from org.apache.logging.log4j.spi.LoggerContextFactory.isClassLoaderDependent.

Determines whether or not this factory and perhaps the underlying ContextSelector behavior depend on the callers classloader. This method should be overridden by implementations, however a default method is provided which always returns true to preserve the old behavior.

Annotations
@Override
removeContextback to summary
public void removeContext(final LoggerContext removeContext)

Implements org.apache.logging.log4j.spi.LoggerContextFactory.removeContext.

Doc from org.apache.logging.log4j.spi.LoggerContextFactory.removeContext.

Removes knowledge of a LoggerContext.

Parameters
removeContext:LoggerContext

The context to remove.

Annotations
@Override