Reputation: 3918
I've been searching on internet and ESQL/WebSphere MessageBroker documentations, to find a way of printing a variable's value so that i can trace it in Broker Logs. Like System.out.println() in java.
I can't debug the messageflow because of some technical issues, so could you please suggest me how to do it or any workarounds.
Upvotes: 2
Views: 5280
Reputation: 11
User Trace should suffice your need, Put a trace node at the point where you want to log, select the file trace and give a file path, pattern give as:
${CURRENT_TIMESTAMP}
${Root}
${Environment}
${LocalEnvironment}
${ExceptionList}
so it logs everything.
If it's in higher environments, then you have to use the mqsichangetrace
command to enable the trace on flow.
Upvotes: 1
Reputation: 633
UserTrace is supposed to fulfil this role for ESQL but if UserTrace isn't helping then I see a lot of people use static calls out from ESQL to java whcih are then logged.
The java code could be as simple as writing to stdout (which will go in /var/mqsi/components//stdout) but more commonly I see this pattern used with existing java logging frameworks like log4J.
The advantage of this approach is that you unify logging between your JCN's and ESQL compute nodes.
Upvotes: 1
Reputation: 121
Probably the easiest way is:
1) Set a temporary location in the Environment to the value of the variable: SET Environment.temp = yourVar ;
2) Subsequently, in a Trace node, set the Pattern on the Basic tab of the Trace node to that temporary location: ${Environment.temp}
3) Configure the Trace node to print to a File, User Trace, or the Local Error Log.
4) Deploy and run your flow. Then look in the output of the Trace node.
Upvotes: 0