org.apache.log4j
Class EnhancedMyPatternLayout

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by org.apache.log4j.EnhancedPatternLayout
          extended by org.apache.log4j.EnhancedMyPatternLayout
All Implemented Interfaces:
OptionHandler

public class EnhancedMyPatternLayout
extends EnhancedPatternLayout

Example showing how to extend EnhancedPatternLayout 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, EnhancedPatternLayout

Field Summary
 
Fields inherited from class org.apache.log4j.EnhancedPatternLayout
BUF_SIZE, DEFAULT_CONVERSION_PATTERN, MAX_CAPACITY, PATTERN_RULE_REGISTRY, TTCC_CONVERSION_PATTERN
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
EnhancedMyPatternLayout()
           
EnhancedMyPatternLayout(java.lang.String pattern)
           
 
Method Summary
 PatternParser createPatternParser(java.lang.String pattern)
           
 
Methods inherited from class org.apache.log4j.EnhancedPatternLayout
activateOptions, format, getConversionPattern, ignoresThrowable, setConversionPattern
 
Methods inherited from class org.apache.log4j.Layout
getContentType, getFooter, getHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnhancedMyPatternLayout

public EnhancedMyPatternLayout()

EnhancedMyPatternLayout

public EnhancedMyPatternLayout(java.lang.String pattern)
Method Detail

createPatternParser

public PatternParser createPatternParser(java.lang.String pattern)
Overrides:
createPatternParser in class EnhancedPatternLayout


Copyright © 2010 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras Companion for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.