Package org.apache.camel.spi
Interface Tracer
- All Superinterfaces:
AutoCloseable,Service,StaticService
SPI for tracing messages.
-
Method Summary
Modifier and TypeMethodDescriptionTo use a custom exchange formatter for formatting the output of theExchangein the trace logs.longNumber of traced messagesTracing pattern to match which node EIPs to trace.booleanWhether the tracer is enabledbooleanWhether the tracer is standby.booleanWhether to include tracing of before/after routes to trace the input and responses of routes.booleanWhether to trace routes that is created from Rest DSL.booleanWhether tracing should trace inner details from route templates (or kamelets).voidReset trace countervoidsetEnabled(boolean enabled) Whether the tracer is enabledvoidsetExchangeFormatter(ExchangeFormatter exchangeFormatter) To use a custom exchange formatter for formatting the output of theExchangein the trace logs.voidsetStandby(boolean standby) Whether the tracer is standby.voidsetTraceBeforeAndAfterRoute(boolean traceBeforeAndAfterRoute) Whether to include tracing of before/after routes to trace the input and responses of routes.voidsetTracePattern(String tracePattern) Tracing pattern to match which node EIPs to trace.voidsetTraceRests(boolean traceRests) Whether to trace routes that is created from route templates or kamelets.voidsetTraceTemplates(boolean traceTemplates) Whether tracing should trace inner details from route templates (or kamelets).booleanshouldTrace(NamedNode definition) Whether or not to trace the given processor definition.voidtraceAfterNode(NamedNode node, Exchange exchange) Trace after the given nodevoidtraceAfterRoute(NamedRoute route, Exchange exchange) Trace after the route (eg output from route)voidtraceAfterRoute(Route route, Exchange exchange) Deprecated.voidtraceBeforeNode(NamedNode node, Exchange exchange) Trace before the given nodevoidtraceBeforeRoute(NamedRoute route, Exchange exchange) Trace before the route (eg input to route)
-
Method Details
-
shouldTrace
Whether or not to trace the given processor definition.- Parameters:
definition- the processor definition- Returns:
- true to trace, false to skip tracing
-
traceBeforeRoute
Trace before the route (eg input to route)- Parameters:
route- the route EIPexchange- the exchange
-
traceBeforeNode
Trace before the given node- Parameters:
node- the node EIPexchange- the exchange
-
traceAfterNode
Trace after the given node- Parameters:
node- the node EIPexchange- the exchange
-
traceAfterRoute
Trace after the route (eg output from route)- Parameters:
route- the route EIPexchange- the exchange
-
traceAfterRoute
Deprecated.Trace after the route (eg output from route)- Parameters:
route- the routeexchange- the exchange
-
getTraceCounter
long getTraceCounter()Number of traced messages -
resetTraceCounter
void resetTraceCounter()Reset trace counter -
isEnabled
boolean isEnabled()Whether the tracer is enabled -
setEnabled
void setEnabled(boolean enabled) Whether the tracer is enabled -
isStandby
boolean isStandby()Whether the tracer is standby.If a tracer is in standby then the tracer is activated during startup and are ready to be enabled manually via JMX or calling the enabled method.
-
setStandby
void setStandby(boolean standby) Whether the tracer is standby.If a tracer is in standby then the tracer is activated during startup and are ready to be enabled manually via JMX or calling the enabled method.
-
isTraceRests
boolean isTraceRests()Whether to trace routes that is created from Rest DSL. -
setTraceRests
void setTraceRests(boolean traceRests) Whether to trace routes that is created from route templates or kamelets. -
isTraceTemplates
boolean isTraceTemplates()Whether tracing should trace inner details from route templates (or kamelets). Turning this off can reduce the verbosity of tracing when using many route templates, and allow to focus on tracing your own Camel routes only. -
setTraceTemplates
void setTraceTemplates(boolean traceTemplates) Whether tracing should trace inner details from route templates (or kamelets). Turning this off can reduce the verbosity of tracing when using many route templates, and allow to focus on tracing your own Camel routes only. -
getTracePattern
String getTracePattern()Tracing pattern to match which node EIPs to trace. For example to match all To EIP nodes, use to*. The pattern matches by node and route id's Multiple patterns can be separated by comma. -
setTracePattern
Tracing pattern to match which node EIPs to trace. For example to match all To EIP nodes, use to*. The pattern matches by node and route id's Multiple patterns can be separated by comma. -
isTraceBeforeAndAfterRoute
boolean isTraceBeforeAndAfterRoute()Whether to include tracing of before/after routes to trace the input and responses of routes. -
setTraceBeforeAndAfterRoute
void setTraceBeforeAndAfterRoute(boolean traceBeforeAndAfterRoute) Whether to include tracing of before/after routes to trace the input and responses of routes. -
getExchangeFormatter
ExchangeFormatter getExchangeFormatter()To use a custom exchange formatter for formatting the output of theExchangein the trace logs. -
setExchangeFormatter
To use a custom exchange formatter for formatting the output of theExchangein the trace logs.
-
traceAfterRoute(NamedRoute, Exchange)