Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to differentiate logs in different modules

VyankteshK
Tera Contributor

Hi Team, I just want to print log message.

I am doing this through Background Script"

var message="Hi";
gs.log(message);

 This is working fine and showing entry in syslog table, but I am using the same in scheduled job and business rules it is not working.

 

just add on question to this.

gs.log();  this method where we can use in the background script it is working , but not in the client script I think due to gs is server side method. but it is also not working in BR. also in scheduled job not working , but working in Scheduled Script Execution

Please help in differentiate this logs in various modules.

 

Thanks in advance to all.

Vyanktesh Khupse

1 ACCEPTED SOLUTION

Not applicable

Hi @VyankteshK ,

gs.log() is working on background script, Business rules and script include, it works when you do coding on server side. If you are working in scoped application please try with gs.info();

 

In client script you can use alert();

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

View solution in original post

2 REPLIES 2

Not applicable

Hi @VyankteshK ,

gs.log() is working on background script, Business rules and script include, it works when you do coding on server side. If you are working in scoped application please try with gs.info();

 

In client script you can use alert();

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

VyankteshK
Tera Contributor

Hello @Community Alums ,

 

Thanks for commenting.

 

Vyanktesh.