Log4j 1.1b7

org.apache.log4j
Class BasicConfigurator

java.lang.Object
  |
  +--org.apache.log4j.BasicConfigurator
Direct Known Subclasses:
DOMConfigurator, PropertyConfigurator

public class BasicConfigurator
extends Object

Use this class to quickly configure the package.

For file based configuration see PropertyConfigurator. For XML based configuration see DOMConfigurator.

Since:
0.8.1
Author:
Ceki Gülcü

Field Summary
static String DISABLE_KEY
          DISABLE_KEY is the name of the constant holding the string value log4j.disable.
static String DISABLE_OVERRIDE_KEY
          DISABLE_OVERRIDE_KEY is the name of the constant holding the string value log4j.disableOverride.
static String INHERITED
          Special priority value signifying inherited behaviour.
 
Constructor Summary
protected BasicConfigurator()
           
 
Method Summary
protected  void addRenderer(Hierarchy hierarchy, String renderedClassName, String renderingClassName)
          Used by subclasses to add a renderer to the hierarchy passed as parameter.
static void configure()
          Add a FileAppender that uses PatternLayout using the PatternLayout.TTCC_CONVERSION_PATTERN and prints to System.out to the root category.
static void configure(Appender appender)
          Add appender to the root category.
static void disable(Priority p)
          Deprecated. Use Category.getDefaultHierarchy().disable(p) instead.
static void disable(String priorityStr)
          Deprecated. Use Category.getDefaultHierarchy().disable() instead.
static void disableAll()
          Deprecated. Use Category.getDefaultHierarchy().disableAll() instead.
static void disableDebug()
          Deprecated. Use Category.getDefaultHierarchy().disableDebug() instead.
static void disableInfo()
          Deprecated. Use Category.getDefaultHierarchy().disableInfo() instead.
static void enableAll()
          Deprecated. Use Category.getDefaultHierarchy().enableAll() instead.
static void resetConfiguration()
          Reset the default hierarchy to its defaut.
static void resetConfiguration(Hierarchy hierarchy)
          Deprecated. Use hierarchy.resetConfiguration() instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLE_OVERRIDE_KEY

public static final String DISABLE_OVERRIDE_KEY

DISABLE_OVERRIDE_KEY is the name of the constant holding the string value log4j.disableOverride.

Setting the system property log4j.disableOverride to "true" or any other value than "false" overrides the effects of all methods Hierarchy.disable(java.lang.String), Hierarchy.disableAll(), Hierarchy.disableDebug() and Hierarchy.disableInfo(). Thus, enabling normal evaluation of logging requests, i.e. according to the Basic Selection Rule.

If both log4j.disableOverride and a log4j.disable options are present, then log4j.disableOverride as the name indicates overrides any log4j.disable options.

Since:
0.8.5

DISABLE_KEY

public static final String DISABLE_KEY

DISABLE_KEY is the name of the constant holding the string value log4j.disable.

Setting the system property log4j.disable to DEBUG, INFO, WARN, ERROR or FATAL is equivalent to calling the Hierarchy.disable(java.lang.String) method with the corresponding priority.

If both log4j.disableOverride and a log4j.disable options are present, then log4j.disableOverride as the name indicates overrides any log4j.disable options.

Since:
1.1

INHERITED

public static final String INHERITED
Special priority value signifying inherited behaviour. The current value of this string constant is inherited.
Constructor Detail

BasicConfigurator

protected BasicConfigurator()
Method Detail

addRenderer

protected void addRenderer(Hierarchy hierarchy,
                           String renderedClassName,
                           String renderingClassName)
Used by subclasses to add a renderer to the hierarchy passed as parameter.

disable

public static void disable(String priorityStr)
Deprecated. Use Category.getDefaultHierarchy().disable() instead.

See Hierarchy.disable(String).

disable

public static void disable(Priority p)
Deprecated. Use Category.getDefaultHierarchy().disable(p) instead.

See Hierarchy.disable(Priority).

disableAll

public static void disableAll()
Deprecated. Use Category.getDefaultHierarchy().disableAll() instead.

See Hierarchy.disableAll().

disableDebug

public static void disableDebug()
Deprecated. Use Category.getDefaultHierarchy().disableDebug() instead.

See Hierarchy.disableDebug().

disableInfo

public static void disableInfo()
Deprecated. Use Category.getDefaultHierarchy().disableInfo() instead.

See Hierarchy.disableInfo().

enableAll

public static void enableAll()
Deprecated. Use Category.getDefaultHierarchy().enableAll() instead.

See Hierarchy.enableAll().

configure

public static void configure()
Add a FileAppender that uses PatternLayout using the PatternLayout.TTCC_CONVERSION_PATTERN and prints to System.out to the root category.

configure

public static void configure(Appender appender)
Add appender to the root category.
Parameters:
appender - The appender to add to the root category.

resetConfiguration

public static void resetConfiguration()
Reset the default hierarchy to its defaut. It is equivalent to calling Category.getDefaultHierarchy().resetConfiguration(). See Hierarchy.resetConfiguration() for more details.

resetConfiguration

public static void resetConfiguration(Hierarchy hierarchy)
Deprecated. Use hierarchy.resetConfiguration() instead.


Log4j 1.1b7

Please notify me about new log4j releases.