The version of Apache log4j used by SoundHelix.
Clone
HTTPS:
git clone https://vervis.peers.community/repos/aEp6o
SSH:
git clone USERNAME@vervis.peers.community:aEp6o
Branches
Tags
- 1.3alpha-7
- CHAINSAW_2_SANDBOX_MERGE
- CORE_VERSION
- LEVEL_REPLACES_PRIORITY
- PREALPHA_1_3_AS_OF_2004_05_12
- PRE_CHAINSAW_MODEL_CONVERSION
- PRE_UGLI_MOVE
- TAG_CHAINSAW2_MOVE
- log4j-1.2.17
- log4j-1.2.17-rc1
- v1.3alpha8
- v1.3alpha8-temp
- v1_2_1
- v1_2_10-recalled
- v1_2_11
- v1_2_11_rc1
- v1_2_11rc3
- v1_2_12
- v1_2_12_rc1
- v1_2_12_rc2
- v1_2_12_rc3
- v1_2_12_rc4
- v1_2_12_rc5
- v1_2_12_rc6
- v1_2_13
- v1_2_13_rc1
- v1_2_13_rc2
- v1_2_13_site_update
- v1_2_14
- v1_2_14_maven
- v1_2_14_rc1
- v1_2_14_site_update
- v1_2_15
- v1_2_15_rc1
- v1_2_15_rc2
- v1_2_15_rc3
- v1_2_15_rc4
- v1_2_15_rc5
- v1_2_15_rc6
- v1_2_16
- v1_2_16_rc1
- v1_2_16_rc2
- v1_2_17
- v1_2_17-rc1
- v1_2_17_rc1
- v1_2_17_rc2
- v1_2_17_rc3
- v1_2_2
- v1_2_3
- v1_2_4
- v1_2_6
- v1_2_7
- v1_2_9
- v1_2_alpha0
- v1_2_alpha7
- v1_2beta1
- v1_2final
- v1_3alpha_1
- v1_3alpha_6
- v_1_0
- v_1_0_1
- v_1_0_4
- v_1_1
- v_1_1_1
- v_1_1_2
- v_1_1_3
- v_1_1_b1
- v_1_1b2
- v_1_1b3
- v_1_1b5
- v_1_1b6
- v_1_1b7
- v_1_2beta3
BasicConfigurator.java
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software
* License version 1.1, a copy of which has been included with this
* distribution in the LICENSE.APL file. */
// Contibutors: "Luke Blanshard" <Luke@quiq.com>
// "Mark DONSZELMANN" <Mark.Donszelmann@cern.ch>
// "Muly Oved" <mulyoved@hotmail.com>
package org.apache.log4j;
import org.apache.log4j.helpers.LogLog;
import org.apache.log4j.helpers.OptionConverter;
import org.apache.log4j.or.ObjectRenderer;
import org.apache.log4j.or.RendererMap;
import java.util.Enumeration;
/**
Use this class to quickly configure the package.
<p>For file based configuration see {@link
PropertyConfigurator}. For XML based configuration see {@link
org.apache.log4j.xml.DOMConfigurator DOMConfigurator}.
@since 0.8.1
@author Ceki Gülcü */
public class BasicConfigurator {
/**
<p><code>DISABLE_OVERRIDE_KEY</code> is the name of the constant
holding the string value <b>log4j.disableOverride</b>.
<p>Setting the system property <b>log4j.disableOverride</b> to
"true" or any other value than "false" overrides the effects of
all methods {@link Hierarchy#disable}, {@link
Hierarchy#disableAll}, {@link Hierarchy#disableDebug} and {@link
Hierarchy#disableInfo}. Thus, enabling normal evaluation of logging
requests, i.e. according to the <a
href="../../manual.html#selectionRule">Basic Selection Rule</a>.
<p>If both <code>log4j.disableOverride</code> and a
<code>log4j.disable</code> options are present, then
<code>log4j.disableOverride</code> as the name indicates
overrides any <code>log4j.disable</code> options.
@since 0.8.5 */
public static final String DISABLE_OVERRIDE_KEY = "log4j.disableOverride";
/**
<p><code>DISABLE_KEY</code> is the name of the constant
holding the string value <b>log4j.disable</b>.
<p>Setting the system property <b>log4j.disable</b> to DEBUG,
INFO, WARN, ERROR or FATAL is equivalent to calling the {@link
Hierarchy#disable} method with the corresponding priority.
<p>If both <code>log4j.disableOverride</code> and a
<code>log4j.disable</code> options are present, then
<code>log4j.disableOverride</code> as the name indicates
overrides any <code>log4j.disable</code> options.
@since 1.1 */
public static final String DISABLE_KEY = "log4j.disable";
/**
Special priority value signifying inherited behaviour. The
current value of this string constant is <b>inherited</b>.
*/
public static final String INHERITED = "inherited";
// Check if value of(DISABLE_OVERRIDE_KEY) system property is set.
// If it is set to "true" or any value other than "false", then set
// static variable Category.disable to Category.DISABLE_OVERRIDE.
static {
String override = OptionConverter.getSystemProperty(DISABLE_OVERRIDE_KEY, null);
if(override != null) {
Category.defaultHierarchy.setDisableOverride(override);
} else { // check for log4j.disable only in absence of log4j.disableOverride
String disableStr = OptionConverter.getSystemProperty(DISABLE_KEY, null);
if(disableStr != null) {
Category.defaultHierarchy.disable(disableStr);
}
}
}
protected BasicConfigurator() {
}
/**
Used by subclasses to add a renderer to the hierarchy passed as parameter.
*/
protected
void addRenderer(Hierarchy hierarchy, String renderedClassName,
String renderingClassName) {
LogLog.debug("Rendering class: ["+renderingClassName+"], Rendered class: ["+
renderedClassName+"].");
ObjectRenderer renderer = (ObjectRenderer)
OptionConverter.instantiateByClassName(renderingClassName,
ObjectRenderer.class,
null);
if(renderer == null) {
LogLog.error("Could not instantiate renderer ["+renderingClassName+"].");
return;
} else {
try {
Class renderedClass = Class.forName(renderedClassName);
hierarchy.rendererMap.put(renderedClass, renderer);
} catch(ClassNotFoundException e) {
LogLog.error("Could not find class ["+renderedClassName+"].", e);
}
}
}
/**
See {@link Hierarchy#disable(String)}.
@deprecated Use <code>Category.getDefaultHierarchy().disable()</code> instead. */
public
void disable(String priorityStr) {
Category.getDefaultHierarchy().disable(priorityStr);
}
/**
See {@link Hierarchy#disable(Priority)}.
@deprecated Use <code>Category.getDefaultHierarchy().disable(p)</code> instead. */
public
void disable(Priority p) {
}
/**
See {@link Hierarchy#disableAll()}.
@deprecated Use <code>Category.getDefaultHierarchy().disableAll()</code> instead. */
public
void disableAll() {
Category.getDefaultHierarchy().disable(Priority.FATAL);
}
/**
See {@link Hierarchy#disableDebug()}.
@deprecated Use <code>Category.getDefaultHierarchy().disableDebug()</code> instead. */
public
void disableDebug() {
Category.getDefaultHierarchy().disable(Priority.DEBUG);
}
/**
See {@link Hierarchy#disableInfo()}.
@deprecated Use <code>Category.getDefaultHierarchy().disableInfo()</code> instead. */
public
void disableInfo() {
Category.getDefaultHierarchy().disable(Priority.INFO);
}
/**
See {@link Hierarchy#enableAll()}.
@deprecated Use <code>Category.getDefaultHierarchy().enableAll()</code> instead. */
public
void enableAll() {
Category.getDefaultHierarchy().disable(Priority.INFO);
}
/**
Add a {@link FileAppender} that uses {@link PatternLayout} using
the {@link PatternLayout#TTCC_CONVERSION_PATTERN} and prints to
<code>System.out</code> to the root category. */
static
public
void configure() {
Category root = Category.getRoot();
root.addAppender(new ConsoleAppender(
new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
}
/**
Add <code>appender</code> to the root category.
@param appender The appender to add to the root category.
*/
static
public
void configure(Appender appender) {
Category root = Category.getRoot();
root.addAppender(appender);
}
/**
Reset the default hierarchy to its defaut. It is equivalent to
calling
<code>Category.getDefaultHierarchy().resetConfiguration()</code>.
See {@link Hierarchy#resetConfiguration()} for more details. */
public
static
void resetConfiguration() {
Category.defaultHierarchy.resetConfiguration();
}
/**
@deprecated Use <code>hierarchy.resetConfiguration()</code> instead.
*/
public
static
void resetConfiguration(Hierarchy hierarchy) {
hierarchy.resetConfiguration();
}
}