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.
class
: outputs the name of the class that has logged the
message. The optional short
subformat removes the
package name. Warning : this pattern works only if formatting occurs in
the same thread as the call to Logger, i.e. it won't work with
AsyncLogTarget
. The class name is embeded by a <class>
element.
thread
: outputs the name of the current thread (first element
on the context stack). The thread name is surrounded by a <thread>
element.
uri
: outputs the request URI (<uri>).-
category
: outputs the log category (<category>).-
message
: outputs the message (<message>).-
time
: outputs the time (<time>).-
rtime
: outputs the relative time (<relative-time>).-
throwable
: outputs the exception (<throwable>).-
priority
: outputs the priority (<priority>).-
- Version:
- CVS $Id: XMLCocoonLogFormatter.java,v 1.6 2002/02/22 07:03:58 cziegeler Exp $
- Author:
- Peter Donald, Sylvain Wallez, Carsten Ziegeler
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 |
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
XMLCocoonLogFormatter
public XMLCocoonLogFormatter()
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.