יום שישי, 25 באפריל 2014

Logging element in the Camel route

Adding logging element to the Camel route is very simple (By all mean).
The following code adds a logging element to the cxfrs route :

@Override
public void configure() throws Exception {   	
	from(uri)
		.log(LoggingLevel.INFO , "the body ${body} and the operation ${in.header[" + CxfConstants.OPERATION_NAME +"]}")
		.process(new Processor() {
		public void process(Exchange exchange) throws Exception { 

The syntax in the demo of the log template is based on Camel Simple Expression Language.
And the result after calling :
http://localhost:8080/camel-example-cxfrs-tomcat/webservices/myData/RsService/SayHello/Mazal-saadon
Is:

2014-04-25 13:38:47,782 [bio-8080-exec-4] INFO  route1                         - the body Mazal-saadon and the operation SayHello

אין תגובות:

הוסף רשומת תגובה