Package org.apache.log4j.config
Class PropertyPrinter
- java.lang.Object
-
- org.apache.log4j.config.PropertyPrinter
-
- All Implemented Interfaces:
PropertyGetter.PropertyCallback
public class PropertyPrinter extends Object implements PropertyGetter.PropertyCallback
Prints the configuration of the log4j default hierarchy (which needs to be auto-initialized) as a propoperties file on aPrintWriter.- Author:
- Anders Kristensen
-
-
Field Summary
Fields Modifier and Type Field Description protected HashtableappenderNamesprotected booleandoCapitalizeprotected HashtablelayoutNamesprotected intnumAppendersprotected PrintWriterout
-
Constructor Summary
Constructors Constructor Description PropertyPrinter(PrintWriter out)PropertyPrinter(PrintWriter out, boolean doCapitalize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stringcapitalize(String name)voidfoundProperty(Object obj, String prefix, String name, Object value)protected StringgenAppName()protected booleanisGenAppName(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]+.static voidmain(String[] args)voidprint(PrintWriter out)Prints the configuration of the default log4j hierarchy as a Java properties file on the specified Writer.protected voidprintOptions(PrintWriter out, Object obj, String fullname)protected voidprintOptions(PrintWriter out, Category cat)protected voidprintOptions(PrintWriter out, Logger cat)
-
-
-
Field Detail
-
numAppenders
protected int numAppenders
-
appenderNames
protected Hashtable appenderNames
-
layoutNames
protected Hashtable layoutNames
-
out
protected PrintWriter out
-
doCapitalize
protected boolean doCapitalize
-
-
Constructor Detail
-
PropertyPrinter
public PropertyPrinter(PrintWriter out)
-
PropertyPrinter
public PropertyPrinter(PrintWriter out, boolean doCapitalize)
-
-
Method Detail
-
genAppName
protected String genAppName()
-
isGenAppName
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]+.
-
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!
-
printOptions
protected void printOptions(PrintWriter out, Category cat)
- Since:
- 1.2.15
-
printOptions
protected void printOptions(PrintWriter out, Logger cat)
-
printOptions
protected void printOptions(PrintWriter out, Object obj, String fullname)
-
foundProperty
public void foundProperty(Object obj, String prefix, String name, Object value)
- Specified by:
foundPropertyin interfacePropertyGetter.PropertyCallback
-
main
public static void main(String[] args)
-
-