logging messages in server-side scripts

Pranai
Tera Expert

In a privately-scoped application, which methods are used for logging messages in server-side scripts? (Choose
two.)
A.gs.logError()
B.gs.log()
C.gs.debug()
D.gs.info()
E.gs.error(

4 ACCEPTED SOLUTIONS

Nikhil Bajaj9
Tera Sage

Hi @Pranai ,

 

Correct Answer is:-

C.gs.debug()
D.gs.info()

 

If my answer helped you, please mark it- solution accepted.

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

View solution in original post

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Pranai 

 

C.gs.debug()
E.gs.error()

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

Shashank_Jain
Kilo Sage

@Pranai ,

 

Correct answer for this would be

C. gs.debug()

D. gs.info()

 

Explanation :

 

A.  gs.logError() – Deprecated method, not supported in scoped apps.
B.  gs.log() – Not supported in scoped apps (only global).
C.  gs.debug() – Supported, logs debug-level messages.
D.  gs.info() – Supported, logs informational messages.
E.  gs.error() – Supported, but specifically for error messages (not general logging).

 

 

 

If this works, please mark it as helpful/accepted — it keeps me motivated and helps others find solutions.
Shashank Jain

View solution in original post

GlideFather
Tera Patron

Hi @Pranai the question can be interpreted very widely but with a gun pointing at my head I’d go with gs.info() and gs.debug() 🧏‍♂️

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


View solution in original post

6 REPLIES 6

@Pranai 

please refer to the Developer site:

Debugging Business Rules | ServiceNow Developer

 

The scoped GlideSystem API has logging methods:

All of the logging methods write to the System Log. Pass strings, variables that resolve to strings, or methods that resolve to strings into the logging methods

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Its_Azar
Tera Guru

Hi @Pranai

In a custom-scoped apps, you can’t use all the global logging APIs. The supported methods for logging are 

gs.info() 

gs.debug()

 

i use these all the time

 

If this helps kindly accept the solutioin thanks.

 

 

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India