org.log4j.examples
Class MyPatternLayout
java.lang.Object
|
+--org.log4j.Layout
|
+--org.log4j.PatternLayout
|
+--org.log4j.examples.MyPatternLayout
- All Implemented Interfaces:
- OptionHandler
- public class MyPatternLayout
- extends PatternLayout
Example showing how to extend PatternLayout to recognize additional
conversion characters.
In this case MyPatternLayout recognizes %# conversion pattern. It
outputs the value of an internal counter which is also incremented
at each call.
See source code
for more details.
- Author:
- Anders Kristensen
- See Also:
MyPatternParser
,
PatternLayout
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyPatternLayout
public MyPatternLayout()
MyPatternLayout
public MyPatternLayout(String pattern)
createPatternParser
public PatternParser createPatternParser(String pattern)
- Description copied from class:
PatternLayout
- Returns PatternParser used to parse the conversion string. Subclasses
may override this to return a subclass of PatternParser which recognize
custom conversion characters.
- Overrides:
createPatternParser
in class PatternLayout
main
public static void main(String[] args)
Please notify me about new log4j releases.