org.apache.log4j
Class PropertyConfigurator

java.lang.Object
  extended by org.apache.log4j.PropertyConfigurator

public class PropertyConfigurator
extends Object

A configurator for properties.


Constructor Summary
PropertyConfigurator()
           
 
Method Summary
static void configure(InputStream inputStream)
          Reads configuration options from an InputStream.
static void configure(Properties properties)
          Read configuration options from properties.
static void configure(String configFileName)
          Read configuration options from configuration file.
static void configure(URL configURL)
          Read configuration options from url configURL.
static void configureAndWatch(String configFilename)
          Like configureAndWatch(String, long) except that the default delay as defined by FileWatchdog.DEFAULT_DELAY is used.
static void configureAndWatch(String configFilename, long delay)
          Read the configuration file configFilename if it exists.
 void doConfigure(InputStream inputStream, LoggerRepository hierarchy)
          Read configuration options from an InputStream.
 void doConfigure(Properties properties, LoggerRepository hierarchy)
          Read configuration options from properties.
 void doConfigure(String configFileName, LoggerRepository hierarchy)
          Read configuration options from configuration file.
 void doConfigure(URL configURL, LoggerRepository hierarchy)
          Read configuration options from url configURL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyConfigurator

public PropertyConfigurator()
Method Detail

doConfigure

public void doConfigure(String configFileName,
                        LoggerRepository hierarchy)
Read configuration options from configuration file.

Parameters:
configFileName - The configuration file
hierarchy - The hierarchy

doConfigure

public void doConfigure(Properties properties,
                        LoggerRepository hierarchy)
Read configuration options from properties. See doConfigure(String, LoggerRepository) for the expected format.

Parameters:
properties - The properties
hierarchy - The hierarchy

doConfigure

public void doConfigure(InputStream inputStream,
                        LoggerRepository hierarchy)
Read configuration options from an InputStream.

Parameters:
inputStream - The input stream
hierarchy - The hierarchy

doConfigure

public void doConfigure(URL configURL,
                        LoggerRepository hierarchy)
Read configuration options from url configURL.

Parameters:
configURL - The configuration URL
hierarchy - The hierarchy

configure

public static void configure(String configFileName)
Read configuration options from configuration file.

Parameters:
configFileName - The configuration file.

configure

public static void configure(URL configURL)
Read configuration options from url configURL.

Parameters:
configURL - The configuration URL

configure

public static void configure(InputStream inputStream)
Reads configuration options from an InputStream.

Parameters:
inputStream - The input stream

configure

public static void configure(Properties properties)
Read configuration options from properties. See doConfigure(String, LoggerRepository) for the expected format.

Parameters:
properties - The properties

configureAndWatch

public static void configureAndWatch(String configFilename)
Like configureAndWatch(String, long) except that the default delay as defined by FileWatchdog.DEFAULT_DELAY is used.

Parameters:
configFilename - A file in key=value format.

configureAndWatch

public static void configureAndWatch(String configFilename,
                                     long delay)
Read the configuration file configFilename if it exists. Moreover, a thread will be created that will periodically check if configFilename has been created or modified. The period is determined by the delay argument. If a change or file creation is detected, then configFilename is read to configure log4j.

Parameters:
configFilename - A file in key=value format.
delay - The delay in milliseconds to wait between each check.


Copyright © 1999-2014 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.