org.apache.log4j
Class PropertyConfigurator

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

public class PropertyConfigurator
extends Object

Since:
0.8.1

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)
           
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)
           
 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)

configure

public static void configure(String configFileName)

configure

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

Since:
0.8.2

configure

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

Since:
1.2.17

configure

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


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.

doConfigure

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


doConfigure

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

Since:
1.2.17

doConfigure

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



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