I am calling a Javascript file from Apache Camel XML DSL running inside Apache ServiceMix as follows:
<endpoint id="myJavascript" uri="language:javascript:file:data/myJavascript.js"/>
...
<to ref="myJavascript"/>
...
I want to log a message from inside myJavascript.js so that the message shows up in the main Camel Context log.
The Camel doc here indicates that the CamelContext Java object is passed through. I was hoping it would include a getter for the logger so that I could do something like this within the script:
var log = context.getLog();
log.debug("Some debug log message");
However, there is no reference to a logger (I noted a getter for a Debugger and an Interceptor though) so it looks like I'm out of luck.
Any ideas how I could achieve this?