cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Add trace and audit log using UDF / JAVA Mapping

itabhishek9
Participant
0 Likes
6,879

Hi SDNites,

I am looking to add

a. trace

b. audit log using,

1. UDF

2. JAVA Mapping.

Can you please give me sample example to implement the same.

Regards,

Abhi

View Entire Topic
RaghuVamseedhar
Active Contributor
0 Likes

Abhishek,

Container

1. To add trace in UDF - sample code,


  public String calculate(Container container) throws StreamTransformationException {

        container.getTrace().addDebugMessage("Message to  Trace");

        return "Sum of numbers";      

    }

2. To add trace in Java Mapping

getTrace().addDebugMessage("Message to Trace"); 

Check code here

markangelo_dihiansan
Active Contributor
0 Likes

Hi Raghu,

Adding to what you've said, there are two more methods for traces.

addInfo("String");

addWarning("String");

addDebugMessage can't be seen when using displayQueue e.g

In test tab, setting trace level to debug will display ALL traces

Setting trace to Info will ONLY display addInfo and addWarning messages.

Setting trace to Warning will ONLY display addWarning messages.

Take note that the ability of the system to display the trace messages at runtime ultimately depends on the configuration in sxmb_adm -> integration engine configuration -> specific configuration -> trace level (not sure about single stack).

setting it to 3 = setting the trace to debug

setting it to 2 = setting the trace to info

setting it to 1 = setting the trace to warning.

Auditlog traces can only be added via adapter module.

Regards,

Mark

Former Member
0 Likes

refer this for SIngle stack