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

Groovy script how to write trace statements

michaeljohn82
Participant
0 Likes
3,282

Dear All,

While writing java code we normally use System.out.println to display some helpful messages in the code and also help troubleshooting process. Is there any similar way in Groovy where we can know which code statement is causing the issue by writing some text to console log?

Accepted Solutions (1)

Accepted Solutions (1)

MortenWittrock
SAP Mentor
SAP Mentor

Hi Michael

You can write to the Message Processing Log (MPL). Check out the documentation here.

Regards,

Morten

michaeljohn82
Participant

Hi Morten,

Thank you. Yes, I saw this in the help but was not sure how to view the log statements. I kept the iFlow in Tracing mode and tried to view the log statements but couldn't find it. I will close this for now as the concept is clear and will try with different iFlows to see the effect.

Answers (1)

Answers (1)

Yogananda
Product and Topic Expert
Product and Topic Expert
0 Likes

michaeljohn82

Yes, you can use Groovy's println() method to print messages to the console log. This is the same as System.out.println in Java.


For example: println("This statement will be printed to the console log")

michaeljohn82
Participant
0 Likes

Hi Yogananda - Thanks. I believe this is referring to the IDE console log. I was referring to something I can see CPI logs. Like AbstractTrace object in PI/PO mapping where we can show some helpful text in the code in the message monitor. Is there any similar feature here?