⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.log4j.config

Class PropertyPrinter

java.lang.Object
|
+--org.apache.log4j.config.PropertyPrinter

All Implemented Interfaces:
PropertyGetter.PropertyCallback


public class PropertyPrinter
extends java.lang.Object
implements PropertyGetter.PropertyCallback

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

Field Summary

Hashtable

appenderNames

boolean

doCapitalize

Hashtable

layoutNames

int

numAppenders

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

PrintWriter

out

Constructor Summary

PropertyPrinter(PrintWriter out)

PropertyPrinter(PrintWriter out, boolean doCapitalize)

Method Summary

static String

capitalize(String name)

void

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

String

genAppName()

boolean

isGenAppName(String name)

Returns true if the specified appender name is considered to have been generated, i.e.

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.

void

printOptions(PrintWriter out, org.apache.log4j.Category cat)

void

printOptions(PrintWriter out, Object obj, String fullname)

Field Details

appenderNames

protected Hashtable appenderNames


doCapitalize

protected boolean doCapitalize


layoutNames

protected Hashtable layoutNames


numAppenders

protected int numAppenders

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

Author:
Anders Kristensen

out

protected PrintWriter out

Constructor Details

PropertyPrinter

public PropertyPrinter(PrintWriter out)

Parameters:
out

PropertyPrinter

public PropertyPrinter(PrintWriter out, boolean doCapitalize)

Parameters:
out
doCapitalize

Method Details

capitalize

public static String capitalize(String name)

Parameters:
name

foundProperty

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

Parameters:
obj
prefix
name
value

genAppName

protected String genAppName()


isGenAppName

protected boolean isGenAppName(String name)

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

Parameters:
name

main

public static void main(String[] args)

Parameters:
args

print

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!

Parameters:
out

printOptions

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

Parameters:
out
obj
fullname

printOptions

protected void printOptions(PrintWriter out, org.apache.log4j.Category cat)

Parameters:
out
cat