ExtendedPatternFormatter (LogKit API)
Keywords: org.apache.log.format.ExtendedPatternFormatter,ExtendedPatternFormatter class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.log.format
Class ExtendedPatternFormatter

    java.lang.Object
      |
      +--org.apache.log.format.PatternFormatter
            |
            +--org.apache.log.format.ExtendedPatternFormatter

All Implemented Interfaces:
  Formatter, Formatter

Direct Known Subclasses:
  AvalonFormatter

public class ExtendedPatternFormatter
extends PatternFormatter

Formatter especially designed for debugging applications. This formatter extends the standard PatternFormatter to add two new possible expansions. These expansions are %{method} and %{thread}. In both cases the context map is first checked for values with specified key. This is to facilitate passing information about caller/thread when threads change (as in AsyncLogTarget). They then attempt to determine appropriate information dynamically.

Version:
  CVS $Revision: 1.11 $ $Date: 2003/02/09 23:33:22 $
Author:
  Avalon Development Team, Peter Donald

Nested Class Summary

Nested classes inherited from class org.apache.log.format.PatternFormatter
`PatternFormatter.PatternRun`

Field Summary

Fields inherited from class org.apache.log.format.PatternFormatter
`MAX_TYPE`

Constructor Summary
`ExtendedPatternFormatter(String format)` Creation of a new extended pattern formatter.
`ExtendedPatternFormatter(String format, int callStackOffset)` Creation of a new extended pattern formatter.

Method Summary
`protected String` | `formatPatternRun(LogEvent event, PatternFormatter.PatternRun run)` Formats a single pattern run (can be extended in subclasses).
`protected int` | `getTypeIdFor(String type)` Retrieve the type-id for a particular string.

Methods inherited from class org.apache.log.format.PatternFormatter
`format, getCategory, getContext, getContextMap, getContextStack, getMessage, getPriority, getRTime, getStackTrace, getThread, getTime, parse, setFormat`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ExtendedPatternFormatter

    public ExtendedPatternFormatter(String format)

  Creation of a new extended pattern formatter.

Parameters:
  `format` - the format string

### ExtendedPatternFormatter

    public ExtendedPatternFormatter(String format,
                                    int callStackOffset)

  Creation of a new extended pattern formatter.

Parameters:
  `format` - the format string
  `callStackOffset` - the offset

Method Detail

### getTypeIdFor

    protected int getTypeIdFor(String type)

  Retrieve the type-id for a particular string.

  Overrides:
    `getTypeIdFor` in class `PatternFormatter`
  Parameters:
    `type` - the string
  Returns:
    the type-id

### formatPatternRun

    protected String formatPatternRun(LogEvent event,
                                      PatternFormatter.PatternRun run)

  Formats a single pattern run (can be extended in subclasses).

  Overrides:
    `formatPatternRun` in class `PatternFormatter`
  Parameters:
    `event` - the log event
    `run` - the pattern run to format.
  Returns:
    the formatted result.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Jakarta Project. All Rights Reserved.