The CreatorCon Call for Content is officially open! Get started here.

How to use gs.log in ui action

test1231998
Tera Contributor

How to use gs.log() in ui action.I wanted to check if the state is changing to assess in the ui action please can anyone tell me how to check this

find_real_file.png

4 REPLIES 4

Community Alums
Not applicable

Hi Deepika,

you cant - you can use console.log() or JSLog() [ServiceNow's logger for frontend] but not same as gs.log() [ which writes in the log]. As alternative you can try with an AJAX but I dont believe thats a good idea - too may DB hits for something you need only on the front end. Apart from that there is a way to check all Tomcat's activities by appending this to your ServiceNow's URL - https://your.sn_inastance.com/channel.do?sysparm_channel=logtail

But there is a way too much data in there if you ask me 🙂

 

Cheers,

Joro

asifnoor
Kilo Patron

Hi,

use JSLog() for debugging in client scripts.

https://docs.servicenow.com/bundle/paris-application-development/page/script/debugging/concept/c_Wri...

Mark the comment as a correct answer if this has answered your question.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Your UI action is client script so gs.log() won't work

You can add alert statement to check the value

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@deepika 

Hope you are doing good.

Did my reply answer your question?

Would you mind marking the best matching answer as correct and helpful, to close this thread?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader