org.apache.cocoon.util.log
Class XMLCocoonLogFormatter

java.lang.Object
  |
  +--org.apache.cocoon.util.log.XMLCocoonLogFormatter
All Implemented Interfaces:
org.apache.log.format.Formatter

public class XMLCocoonLogFormatter
extends java.lang.Object
implements org.apache.log.format.Formatter

A refactoring of org.apache.log.format.PatternFormatter and org.apache.cocoon.util.log.CocoonLogFormatter for producing XML format. This formater formats the LogEntries according to given input types. Each log entry is inside a <log-entry> element and each information is inside an own element.

Version:
CVS $Id: XMLCocoonLogFormatter.java,v 1.6 2002/02/22 07:03:58 cziegeler Exp $
Author:
Peter Donald, Sylvain Wallez, Carsten Ziegeler

Inner Class Summary
static class XMLCocoonLogFormatter.CallStack
          Hack to get the call stack as an array of classes.
 
Field Summary
protected  java.text.SimpleDateFormat dateFormatter
           
protected static java.lang.String EOL
           
protected static int TYPE_CATEGORY
           
protected static int TYPE_CLASS
           
protected static int TYPE_CLASS_SHORT
           
protected static java.lang.String TYPE_CLASS_SHORT_STR
           
protected static java.lang.String TYPE_CLASS_STR
           
protected static int TYPE_MESSAGE
           
protected static int TYPE_PRIORITY
           
protected static int TYPE_RELATIVE_TIME
           
protected static int TYPE_REQUEST_URI
           
protected static int TYPE_THREAD
           
protected static int TYPE_THROWABLE
           
protected static int TYPE_TIME
           
protected  int[] types
           
static java.lang.String[] typeStrings
           
 
Constructor Summary
XMLCocoonLogFormatter()
           
 
Method Summary
 java.lang.String format(org.apache.log.LogEvent event)
          Format the event according to the pattern.
protected  int getTypeIdFor(java.lang.String type)
          Retrieve the type-id for a particular string.
 void setTypes(java.lang.String typeString)
          Set the types from a whitespace separated string
 void setTypes(java.lang.String[] typeStrings)
          Set the types from an array of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_CLASS_STR

protected static final java.lang.String TYPE_CLASS_STR

TYPE_CLASS_SHORT_STR

protected static final java.lang.String TYPE_CLASS_SHORT_STR

TYPE_REQUEST_URI

protected static final int TYPE_REQUEST_URI

TYPE_CATEGORY

protected static final int TYPE_CATEGORY

TYPE_MESSAGE

protected static final int TYPE_MESSAGE

TYPE_TIME

protected static final int TYPE_TIME

TYPE_RELATIVE_TIME

protected static final int TYPE_RELATIVE_TIME

TYPE_THROWABLE

protected static final int TYPE_THROWABLE

TYPE_PRIORITY

protected static final int TYPE_PRIORITY

TYPE_CLASS

protected static final int TYPE_CLASS

TYPE_CLASS_SHORT

protected static final int TYPE_CLASS_SHORT

TYPE_THREAD

protected static final int TYPE_THREAD

typeStrings

public static final java.lang.String[] typeStrings

EOL

protected static final java.lang.String EOL

dateFormatter

protected final java.text.SimpleDateFormat dateFormatter

types

protected int[] types
Constructor Detail

XMLCocoonLogFormatter

public XMLCocoonLogFormatter()
Method Detail

format

public java.lang.String format(org.apache.log.LogEvent event)
Format the event according to the pattern.
Specified by:
format in interface org.apache.log.format.Formatter
Parameters:
event - the event
Returns:
the formatted output

getTypeIdFor

protected int getTypeIdFor(java.lang.String type)
Retrieve the type-id for a particular string.
Parameters:
type - the string
Returns:
the type-id

setTypes

public void setTypes(java.lang.String[] typeStrings)
Set the types from an array of strings.

setTypes

public void setTypes(java.lang.String typeString)
Set the types from a whitespace separated string


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.