chepaiytrath
chepaiytrath

Reputation: 718

How can logging be done from compute node in IBM integration Toolkit

I am using IBM Integration Toolkit in order to implement a WMB msgflow. Can logging be done from within this node or do I need to use an additional Java compute node for this purpose? Any references would be helpful.

Upvotes: 2

Views: 3295

Answers (3)

Mostafa Mabrouk
Mostafa Mabrouk

Reputation: 21

Here are the steps:

  1. Download whatever version you want of Log4J.
  2. Create a Java Project and import the jar files into it then add the jars to the project classpath (open the java prespective - right click on the project - select properties - - select the Library tab - add the jars).
  3. Create a library and add the JavaProject to it.
  4. Create an ESQL file in that library and declare an external function. Below is an example of what it should look like CREATE FUNCTION myProc1( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER ) RETURNS INTEGER LANGUAGE JAVA EXTERNAL NAME "com.ibm.broker.test.MyClass.myMethod1"; For further elaboration you can refer to the knowledge centre page: https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak04960_.htm
  5. Now you can call the ESQL function that you mapped in that ESQL file.

Upvotes: 1

TonyY
TonyY

Reputation: 703

You can use a built-in node which is "Trace node", write the records to the user trace file, another file, or the local error log (which contains error and information messages written by all other IBM® Integration Bus components).

example: To use logging response time

Upvotes: 1

P.An
P.An

Reputation: 353

The only one way I am aware of implementing such functionality is by adding SLF4J (or any other logging java framework of your preference) to IIB Runtime classpath and then write LOGGER.log() in the Java Compute nodes exactly in the same way you would have done it in plain Java. You can also create static wrappers on your log() methods so they can be called from ESQL Compute nodes.

Upvotes: 1

Related Questions