You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gilboy <jo...@gmail.com> on 2015/12/08 09:51:01 UTC

Outputting time to logs for route to process a message

Hi

My route does some business processing - i.e. consumes messages from a
topic, performs some business logic then sends message to a REST endpoint.

After sending the message to the REST endpoint I have 1 final log statement
to state the route is complete for this particular message. I would like to
also output in this log statement the time it took to complete the 
processing of this message on this route. 

I guess there are many ways but was wondering what the simplest and least
invasive is

Thanks
Joe



--
View this message in context: http://camel.465427.n5.nabble.com/Outputting-time-to-logs-for-route-to-process-a-message-tp5774815.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Outputting time to logs for route to process a message

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There is a created timestamp on the exchange when it was created, so
you can access that and log.

Though we could also consider adding an easy to use function in simple
language to output it, so you can do:

.log("This message took ${elapsed} ms to process")




On Tue, Dec 8, 2015 at 9:51 AM, gilboy <jo...@gmail.com> wrote:
> Hi
>
> My route does some business processing - i.e. consumes messages from a
> topic, performs some business logic then sends message to a REST endpoint.
>
> After sending the message to the REST endpoint I have 1 final log statement
> to state the route is complete for this particular message. I would like to
> also output in this log statement the time it took to complete the
> processing of this message on this route.
>
> I guess there are many ways but was wondering what the simplest and least
> invasive is
>
> Thanks
> Joe
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Outputting-time-to-logs-for-route-to-process-a-message-tp5774815.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2