Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to differentiate logs in different modules

Vyanktesh08
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

Community Alums
Not applicable

Hi @Vyanktesh08 ,

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

Community Alums
Not applicable

Hi @Vyanktesh08 ,

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

Vyanktesh08
Tera Contributor

Hello @Community Alums ,

 

Thanks for commenting.

 

Vyanktesh.