org.apache.logging.log4j.core.config
Class Configurator

java.lang.Object
  extended by org.apache.logging.log4j.core.config.Configurator

public final class Configurator
extends Object

Initializes and configure the Logging system. This class provides several ways to construct a LoggerContext using the location of a configuration file, a context name, and various optional parameters.


Method Summary
static LoggerContext initialize(ClassLoader loader, ConfigurationSource source)
          Initializes the Logging Context.
static LoggerContext initialize(ClassLoader loader, ConfigurationSource source, Object externalContext)
          Initializes the Logging Context.
static LoggerContext initialize(String name, ClassLoader loader, String configLocation)
          Initializes the Logging Context.
static LoggerContext initialize(String name, ClassLoader loader, String configLocation, Object externalContext)
          Initializes the Logging Context.
static LoggerContext initialize(String name, ClassLoader loader, URI configLocation)
          Initializes the Logging Context.
static LoggerContext initialize(String name, ClassLoader loader, URI configLocation, Object externalContext)
          Initializes the Logging Context.
static LoggerContext initialize(String name, String configLocation)
          Initializes the Logging Context.
static void shutdown(LoggerContext ctx)
          Shuts down the given logging context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public static LoggerContext initialize(String name,
                                       ClassLoader loader,
                                       String configLocation)
Initializes the Logging Context.

Parameters:
name - The Context name.
loader - The ClassLoader for the Context (or null).
configLocation - The configuration for the logging context.
Returns:
The LoggerContext.

initialize

public static LoggerContext initialize(String name,
                                       ClassLoader loader,
                                       String configLocation,
                                       Object externalContext)
Initializes the Logging Context.

Parameters:
name - The Context name.
loader - The ClassLoader for the Context (or null).
configLocation - The configuration for the logging context.
externalContext - The external context to be attached to the LoggerContext
Returns:
The LoggerContext.

initialize

public static LoggerContext initialize(String name,
                                       String configLocation)
Initializes the Logging Context.

Parameters:
name - The Context name.
configLocation - The configuration for the logging context.
Returns:
The LoggerContext.

initialize

public static LoggerContext initialize(String name,
                                       ClassLoader loader,
                                       URI configLocation)
Initializes the Logging Context.

Parameters:
name - The Context name.
loader - The ClassLoader for the Context (or null).
configLocation - The configuration for the logging context.
Returns:
The LoggerContext.

initialize

public static LoggerContext initialize(String name,
                                       ClassLoader loader,
                                       URI configLocation,
                                       Object externalContext)
Initializes the Logging Context.

Parameters:
name - The Context name.
loader - The ClassLoader for the Context (or null).
configLocation - The configuration for the logging context.
externalContext - The external context to be attached to the LoggerContext
Returns:
The LoggerContext.

initialize

public static LoggerContext initialize(ClassLoader loader,
                                       ConfigurationSource source)
Initializes the Logging Context.

Parameters:
loader - The ClassLoader for the Context (or null).
source - The InputSource for the configuration.
Returns:
The LoggerContext.

initialize

public static LoggerContext initialize(ClassLoader loader,
                                       ConfigurationSource source,
                                       Object externalContext)
Initializes the Logging Context.

Parameters:
loader - The ClassLoader for the Context (or null).
source - The InputSource for the configuration.
externalContext - The external context to be attached to the LoggerContext.
Returns:
The LoggerContext.

shutdown

public static void shutdown(LoggerContext ctx)
Shuts down the given logging context.

Parameters:
ctx - the logging context to shut down, may be null.


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.