THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunkbranches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/TraceInterceptorTest.java} |
In Camel 2.0 this is a bit easier as you just do:
Code Block |
---|
context.setTracing(true);
|
Running the test we get the trace information logged at INFO level (Camel 1.x output):
Code Block |
---|
INFO TraceInterceptor - ID-claus-acer/4412-1222625653890/2-0 -> process(MyProcessor) , Pattern:InOnly , Headers:{to=James} , BodyType:String , Body:Hello London INFO TraceInterceptor - ID-claus-acer/4412-1222625653890/2-0 -> to(mock:a) , Pattern:InOnly , Headers:{to=James} , BodyType:String , Body:Hello London INFO TraceInterceptor - ID-claus-acer/4412-1222625653890/2-0 -> to(mock:b) , Pattern:InOnly , Headers:{to=James} , BodyType:String , Body:Hello London ... INFO TraceInterceptor - ID-claus-acer/4412-1222625653890/2-1 -> process(MyProcessor) , Pattern:InOnly , Headers:{from=Claus} , BodyType:String , Body:This is Copenhagen calling INFO TraceInterceptor - ID-claus-acer/4412-1222625653890/2-1 -> to(mock:a) , Pattern:InOnly , Headers:{from=Claus} , BodyType:String , Body:This is Copenhagen calling INFO TraceInterceptor - ID-claus-acer/4412-1222625653890/2-1 -> to(mock:b) , Pattern:InOnly , Headers:{from=Claus} , BodyType:String , Body:This is Copenhagen calling |
And the same output with Camel 2.0:
Code Block |
---|
INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-0 >>> from(direct:start) --> MyProcessor , Pattern:InOnly, Headers:{to=James}, BodyType:String, Body:Hello London
INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-0 >>> MyProcessor --> mock:a , Pattern:InOnly, Headers:{to=James}, BodyType:String, Body:Hello London
INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-0 >>> mock:a --> mock:b , Pattern:InOnly, Headers:{to=James}, BodyType:String, Body:Hello London
...
INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-1 >>> from(direct:start) --> MyProcessor , Pattern:InOnly, Headers:{from=Claus}, BodyType:String, Body:This is Copenhagen calling
INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-1 >>> MyProcessor --> mock:a , Pattern:InOnly, Headers:{from=Claus}, BodyType:String, Body:This is Copenhagen calling
INFO TraceInterceptor - ID-davsclaus-local-54403-1246038742624-0-1 >>> mock:a --> mock:b , Pattern:InOnly, Headers:{from=Claus}, BodyType:String, Body:This is Copenhagen calling
|
Configuring from Java DSL
...