XMLFormatter (LogKit API)
Keywords: org.apache.log.format.XMLFormatter,XMLFormatter 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 XMLFormatter

    java.lang.Object
      |
      +--org.apache.log.format.XMLFormatter

All Implemented Interfaces:
  Formatter, Formatter

public class XMLFormatter
extends Object
implements Formatter, Formatter

Basic XML formatter that writes out a basic XML-ified log event. Note that this formatter assumes that the category and context values will produce strings that do not need to be escaped in XML.

Author:
  Peter Donald

Constructor Summary
`XMLFormatter()`

Method Summary
`String` | `format(LogEvent event)` Format log event into string.
`void` | `setPrintCategory(boolean printCategory)` Print out category field to log.
`void` | `setPrintContext(boolean printContext)` Print out context field to log.
`void` | `setPrintException(boolean printException)` Print out exception field to log.
`void` | `setPrintMessage(boolean printMessage)` Print out message field to log.
`void` | `setPrintPriority(boolean printPriority)` Print out priority field to log.
`void` | `setPrintRelativeTime(boolean printRelativeTime)` Print out relativeTime field to log.
`void` | `setPrintTime(boolean printTime)` Print out time field to log.

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

Constructor Detail

### XMLFormatter

    public XMLFormatter()

Method Detail

### setPrintTime

    public void setPrintTime(boolean printTime)

  Print out time field to log.

  Parameters:
    `printTime` - true to print time, false otherwise

### setPrintRelativeTime

    public void setPrintRelativeTime(boolean printRelativeTime)

  Print out relativeTime field to log.

  Parameters:
    `printRelativeTime` - true to print relativeTime, false otherwise

### setPrintPriority

    public void setPrintPriority(boolean printPriority)

  Print out priority field to log.

  Parameters:
    `printPriority` - true to print priority, false otherwise

### setPrintCategory

    public void setPrintCategory(boolean printCategory)

  Print out category field to log.

  Parameters:
    `printCategory` - true to print category, false otherwise

### setPrintContext

    public void setPrintContext(boolean printContext)

  Print out context field to log.

  Parameters:
    `printContext` - true to print context, false otherwise

### setPrintMessage

    public void setPrintMessage(boolean printMessage)

  Print out message field to log.

  Parameters:
    `printMessage` - true to print message, false otherwise

### setPrintException

    public void setPrintException(boolean printException)

  Print out exception field to log.

  Parameters:
    `printException` - true to print exception, false otherwise

### format

    public String format(LogEvent event)

  Format log event into string.

  Specified by:
    `format` in interface `Formatter`
  Parameters:
    `event` - the event
  Returns:
    the formatted string

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.