public class

PropertyPrinter

extends Object
implements PropertyGetter.PropertyCallback
java.lang.Object
   ↳ org.apache.log4j.config.PropertyPrinter

Class Overview

Prints the configuration of the log4j default hierarchy (which needs to be auto-initialized) as a propoperties file on a PrintWriter.

Summary

Fields
protected Hashtable appenderNames
protected boolean doCapitalize
protected Hashtable layoutNames
protected int numAppenders
protected PrintWriter out
Public Constructors
PropertyPrinter(PrintWriter out)
PropertyPrinter(PrintWriter out, boolean doCapitalize)
Public Methods
static String capitalize(String name)
void foundProperty(Object obj, String prefix, String name, Object value)
static void main(String[] args)
void print(PrintWriter out)
Prints the configuration of the default log4j hierarchy as a Java properties file on the specified Writer.
Protected Methods
String genAppName()
boolean isGenAppName(String name)
Returns true if the specified appender name is considered to have been generated, that is, if it is of the form A[0-9]+.
void printOptions(PrintWriter out, Logger cat)
void printOptions(PrintWriter out, Object obj, String fullname)
void printOptions(PrintWriter out, Category cat)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.log4j.config.PropertyGetter.PropertyCallback

Fields

protected Hashtable appenderNames

protected boolean doCapitalize

protected Hashtable layoutNames

protected int numAppenders

protected PrintWriter out

Public Constructors

public PropertyPrinter (PrintWriter out)

public PropertyPrinter (PrintWriter out, boolean doCapitalize)

Public Methods

public static String capitalize (String name)

public void foundProperty (Object obj, String prefix, String name, Object value)

public static void main (String[] args)

public void print (PrintWriter out)

Prints the configuration of the default log4j hierarchy as a Java properties file on the specified Writer.

N.B. print() can be invoked only once!

Protected Methods

protected String genAppName ()

protected boolean isGenAppName (String name)

Returns true if the specified appender name is considered to have been generated, that is, if it is of the form A[0-9]+.

protected void printOptions (PrintWriter out, Logger cat)

protected void printOptions (PrintWriter out, Object obj, String fullname)

protected void printOptions (PrintWriter out, Category cat)