net.sf.xbus.base.core.trace
Class FileTrace

java.lang.Object
  extended by net.sf.xbus.base.core.trace.FileTrace
All Implemented Interfaces:
TraceTarget

public class FileTrace
extends java.lang.Object
implements TraceTarget

This implementation of TraceTarget writes the trace to a file.

Configuration:

Chapter Section Key Content
Base FileTrace Filename Name of the file, where the trace is written.


Constructor Summary
FileTrace()
          The constructor builds the name of the trace-file.
 
Method Summary
 java.lang.String getTrace()
          Returns all trace messages as one large string.
 void trace(int priority, java.lang.Object message, java.lang.Throwable t)
          Writes the message, the priority and if given the backtrace of the Throwable to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTrace

public FileTrace()
The constructor builds the name of the trace-file.

%XBUS_HOME%/log/Name_from_Configuration

Remark: Programs that use the FileTrace must be started with: java -Dxbus.home="%XBUS_HOME%"

Method Detail

trace

public void trace(int priority,
                  java.lang.Object message,
                  java.lang.Throwable t)
Writes the message, the priority and if given the backtrace of the Throwable to the file.

It uses the class Formatter.

Specified by:
trace in interface TraceTarget
Parameters:
priority - the priority after which the messages should be traced
message - the message to be traced
t - the stack trace of the Throwable

getTrace

public java.lang.String getTrace()
Returns all trace messages as one large string.

Specified by:
getTrace in interface TraceTarget
Returns:
String - all trace messages