Package 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 aPrintWriter.- Author:
- Anders Kristensen
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashtableappenderNamesprotected booleandoCapitalizeprotected java.util.HashtablelayoutNamesprotected intnumAppendersprotected java.io.PrintWriterout
-
Constructor Summary
Constructors Constructor Description PropertyPrinter(java.io.PrintWriter out)PropertyPrinter(java.io.PrintWriter out, boolean doCapitalize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringcapitalize(java.lang.String name)voidfoundProperty(java.lang.Object obj, java.lang.String prefix, java.lang.String name, java.lang.Object value)protected java.lang.StringgenAppName()protected booleanisGenAppName(java.lang.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(java.lang.String[] args)voidprint(java.io.PrintWriter out)Prints the configuration of the default log4j hierarchy as a Java properties file on the specified Writer.protected voidprintOptions(java.io.PrintWriter out, java.lang.Object obj, java.lang.String fullname)protected voidprintOptions(java.io.PrintWriter out, Category cat)protected voidprintOptions(java.io.PrintWriter out, Logger cat)
-
-
-
Method Detail
-
genAppName
protected java.lang.String genAppName()
-
isGenAppName
protected boolean isGenAppName(java.lang.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(java.io.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(java.io.PrintWriter out, Category cat)- Since:
- 1.2.15
-
printOptions
protected void printOptions(java.io.PrintWriter out, Logger cat)
-
printOptions
protected void printOptions(java.io.PrintWriter out, java.lang.Object obj, java.lang.String fullname)
-
foundProperty
public void foundProperty(java.lang.Object obj, java.lang.String prefix, java.lang.String name, java.lang.Object value)- Specified by:
foundPropertyin interfacePropertyGetter.PropertyCallback
-
capitalize
public static java.lang.String capitalize(java.lang.String name)
-
main
public static void main(java.lang.String[] args)
-
-