|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.util.log.XMLCocoonLogFormatter
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>).host
: outputs the request host header (<priority>).
Nested Class Summary | |
static class |
XMLCocoonLogFormatter.CallStack
Hack to get the call stack as an array of classes. |
Field Summary | |
protected SimpleDateFormat |
dateFormatter
|
protected static int |
TYPE_CATEGORY
|
protected static int |
TYPE_CLASS
|
protected static int |
TYPE_CLASS_SHORT
|
protected static String |
TYPE_CLASS_SHORT_STR
|
protected static String |
TYPE_CLASS_STR
|
protected static int |
TYPE_HOST
|
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 String[] |
typeStrings
|
Constructor Summary | |
XMLCocoonLogFormatter()
|
Method Summary | |
String |
format(org.apache.log.LogEvent event)
Format the event according to the pattern. |
protected int |
getTypeIdFor(String type)
Retrieve the type-id for a particular string. |
void |
setTypes(String typeString)
Set the types from a whitespace separated string |
void |
setTypes(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 |
protected static final String TYPE_CLASS_STR
protected static final String TYPE_CLASS_SHORT_STR
protected static final int TYPE_REQUEST_URI
protected static final int TYPE_CATEGORY
protected static final int TYPE_MESSAGE
protected static final int TYPE_TIME
protected static final int TYPE_RELATIVE_TIME
protected static final int TYPE_THROWABLE
protected static final int TYPE_PRIORITY
protected static final int TYPE_CLASS
protected static final int TYPE_CLASS_SHORT
protected static final int TYPE_THREAD
protected static final int TYPE_HOST
public static final String[] typeStrings
protected final SimpleDateFormat dateFormatter
protected int[] types
Constructor Detail |
public XMLCocoonLogFormatter()
Method Detail |
public String format(org.apache.log.LogEvent event)
format
in interface org.apache.log.format.Formatter
event
- the event
protected int getTypeIdFor(String type)
type
- the string
public void setTypes(String[] typeStrings)
public void setTypes(String typeString)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |