Log4j 1.1b7

org.apache.log4j.examples.appserver
Class AppServerPatternParser

java.lang.Object
  |
  +--org.apache.log4j.helpers.PatternParser
        |
        +--org.apache.log4j.examples.appserver.AppServerPatternParser

public class AppServerPatternParser
extends PatternParser

Extend PatternParser to recognize additional conversion characters suitable for use by application servers.

Author:
Paul Glezen
See Also:
MyPatternLayout, PatternParser, PatternLayout

Field Summary
protected static char COMPONENT_CHAR
          Set to 'b'.
protected static char HOSTNAME_CHAR
          Set to 'h'.
protected static char SERVER_CHAR
          Set to 's'.
protected static char VERSION_CHAR
          Set to 'v'.
 
Fields inherited from class org.apache.log4j.helpers.PatternParser
currentLiteral, formattingInfo, i, pattern, patternLength
 
Constructor Summary
AppServerPatternParser(String pattern)
          Create a parser with the provided pattern.
 
Method Summary
 void finalizeConverter(char formatChar)
          Decide, based on the format character, which subtype of Converter to instanciate.
 
Methods inherited from class org.apache.log4j.helpers.PatternParser
addConverter, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOSTNAME_CHAR

protected static final char HOSTNAME_CHAR
Set to 'h'.

SERVER_CHAR

protected static final char SERVER_CHAR
Set to 's'.

COMPONENT_CHAR

protected static final char COMPONENT_CHAR
Set to 'b'.

VERSION_CHAR

protected static final char VERSION_CHAR
Set to 'v'.
Constructor Detail

AppServerPatternParser

public AppServerPatternParser(String pattern)
Create a parser with the provided pattern.
Parameters:
pattern - a formatting pattern to parse
Method Detail

finalizeConverter

public void finalizeConverter(char formatChar)
Decide, based on the format character, which subtype of Converter to instanciate. The converter is then added to the converter list using the addConverter superclass method. If the format character is not recognized, it is passed to the superclass for interpretation.
Overrides:
finalizeConverter in class PatternParser

Log4j 1.1b7

Please notify me about new log4j releases.