camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Custom log messages
Date Tue, 16 Sep 2008 10:31:41 GMT
2008/9/16 raulvk.soa <>:
> Hi Claus,
> My requirement is a bit different... I need to print human-readable messages
> such as "Validating against XML Schema...", "Validation OK", "Validation
> ERROR", etc... Therefore, I need to be able to specify the message that
> should be printed out when I am building the route.
> Don't know if I have expressed myself clearly...
> Is there any functionality in Camel that will allow me to do send custom log
> messages to the Log component?

You could use a templating engine to transform the message into a
human readable format first, before routing it to the log component.


for example


then your Validating.vm script could generate text extracting some
headers or payload from the message etc.

Maybe if the logging information is simpler; we could just use normal

e.g. using the EL as a kinda templating engine

        setBody().el("Validating ${} blah").

Templating engines come into their own when you are composing a large
page of text such as an email with embedded values; if its a single
line of text for a log message or SMS or something then using EL or
XPath or something might be simpler as you can inline the expression
inside your route.


Open Source Integration

View raw message