Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Option

Default

Description

formatter

 

Sets the Trace Formatter to use. Will default use org.apache.camel.processor.interceptor.DefaultTraceFormatter.

enabled

true

Flag to enable or disable this tracer

logLevel

INFO

The logging level to use: FATAL, ERROR, WARN, INFO, DEBUG, TRACE, OFF

logName

 

The log name to use. Will default use org.apache.camel.processor.interceptor.TraceInterceptor.

traceFilter

null

An exchange Predicate to filter the tracing.

traceInterceptors

false

Flag to enable or disable tracing of interceptors

traceExceptions

true

Flag to enable or disable tracing of thrown exception during processing of the exchange

traceOutExchanges

false

Flag to enable fine grained tracing with a callback for both IN (before) and OUT (after). Is disabled by default which means there is only one trace callback executed.

logStackTrace

false

Camel 2.0: When tracing exception you can control whether the stack trace should be logged also. If not then only the exception class and message is logged.

useJpa

false

Camel 2.0: To use a JpaTraceEventMessage from camel-jpa component as the TraceEventMessage. This requires that camel-jpa.jar is on the classpath.

destinationUri

null

Camel 2.0: Optional destination uri to route TraceEventExchange containing TraceEventMessage with details about the trace. Can be used for custom processing to store traces in database using JPA.

jpaTraceEventMessageClassName

null

Camel 2.3: Fully class name for a custom org.apache.camel.processor.interceptor.TraceEventMessage class which contains the traced information. For example you can use your custom JPA @Entity class to store traced information in a database according to your schema layout.

traceHandler

null

Camel 2.3: To use a custom org.apache.camel.processor.interceptor.TraceEventHandler where you can control what happens when a trace event occurs.

traceInterceptorFactory

null

Camel 2.3: To use a custom org.apache.camel.processor.interceptor.TraceInterceptorFactory where you can create the runtime trace instance which does the actual tracing. It should be a Processor instance. The default tracer is implemented in the class org.apache.camel.processor.interceptor.TraceInterceptor.

...

This works by Camel creates a new TraceEventExchange containing:

  • snapshot of the original traced Exchange as a immutable TraceEventMessage containing String values of the fields, when the interception occurred. This ensures the fields contains the exact data at the given time of interception.
  • the original Exchange can be accessed using getTracedExchange()
Warning

Beware to access the original Exchange to avoid causing any side effects or alter its state. Prefer to access the information from TraceEventMessage

Camel routes the TraceEventExchange synchronously from the point of interception. When its completed Camel will continue routing the original Exchange.

...