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

How to add log in Expression/Validation ?

SOLVED
Highlighted
Pearl

How to add log in Expression/Validation ?

Hi, 

I'd like to add some logs to expression and validation, I tried console.log() and logger.debug() , but both of them don't work.   

How should I add the logs  ? 

 

Regards,

Sean

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to add log in Expression/Validation ?

Hello Sean,

 

console.log works for me, logging correctly in Chrome DevTools. If you want to log on the server side, you can call the service ApplicationLog.Write instead.

 

Regards,
Constantine

View solution in original post

8 REPLIES 8

Re: How to add log in Expression/Validation ?

Hi @seanccc.

 

Can you provide more information regarding your use case?  What do you need to capture?

 

Regards.

 

--Sharon

Re: How to add log in Expression/Validation ?

@slangley ,

 

I want to check if the expression/validation is executed by adding the log like 'The expression xxx is being executed'  and also display the values of the input parameters in the log . 

 

regards,

sean

Re: How to add log in Expression/Validation ?

Hi @seanccc.

 

There isn't any logging built in today.  You could submit this as an idea on the Ideas board, which would allow others to vote on it.  With enough votes, Engineering would consider it for a future release.

 

As an alternative, you could feed the inputs and outputs to an external service which would be responsible for logging the needed information.

 

Regards.

 

--Sharon

 

 

Re: How to add log in Expression/Validation ?

Hello Sean,

 

console.log works for me, logging correctly in Chrome DevTools. If you want to log on the server side, you can call the service ApplicationLog.Write instead.

 

Regards,
Constantine

View solution in original post

Re: How to add log in Expression/Validation ?

@Constantine ,

That's strange, console.log didn't work for me.  I'll try it again to see if it can work. 

Re: How to add log in Expression/Validation ?

Just tried it with 8.4, still works :) Here's an example.

Re: How to add log in Expression/Validation ?

Hi seanccc,

Maybe try the  TW.log client logger.

You can find an example in https://www.ptc.com/en/support/article?n=CS306951

The output will show in the Mashup Console (ctrl+alt+F9)

Re: How to add log in Expression/Validation ?

@Constantine , @smainente 

Both of your approaches work !  Thank you. 

 

Regards,

Sean