Halloween Special 2026! Get Up to 25% OFF Practice Questions! Limited Time - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

ServiceNow CAD Exam - Topic 2 Question 100 Discussion

Posted by Albina on Nov 20, 2025 at 02:38 PM

In a privately-scoped application, which methods are used for logging messages in server-side scripts? (Choose 2 answers)

Suggested Answer: A, D

Understanding Scoped Applications:Scoped applications in ServiceNow are designed to isolate and protect application-specific code and data. Server-side scripts within scoped applications can use the gs (GlideSystem) object for logging and debugging purposes. However, not all gs methods are appropriate or valid for scoped applications.

Valid Logging Methods in Scoped Applications:

gs.info():This method logs informational messages to the system log. It is commonly used for general-purpose logging when developers need to track execution flow or display debug data. Example:

gs.info('This is an informational log message.');

gs.error():This method logs error messages to the system log. It is used to indicate problems or issues encountered during script execution. Example:

gs.error('An error occurred during script execution.');

Incorrect Options Explained:

gs.debug() (Option B): This method is not valid in scoped applications. It is a legacy logging method available in the global scope but restricted in scoped applications.

gs.iog() (Option C): This is a typographical error and not a valid gs method in ServiceNow.

gs.logError() (Option E): This is not a recognized ServiceNow API method. To log errors, gs.error() is used instead.

Best Practices for Logging:

Logging should be meaningful and avoid unnecessary entries to keep logs clean and manageable.

Avoid excessive use of logging in production environments, as it can clutter the system logs and potentially degrade performance.

ServiceNow Developer Documentation on GlideSystem (gs).

SN Pro Tips on debugging and logging practices in scoped applications.


Get Premium CAD Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
30 comments · newest first
NI
Nieves 6 months ago
I’m leaning towards A and C for sure.
FA
Fannie 7 months ago
What about gs.debug()? It’s useful!
TY
Ty 7 months ago
A and E seem right to me.
TH
Thurman 7 months ago
I feel like C is important too.
BE
Ben 7 months ago
I thought gs.info() was for client-side only?
MA
Marshall 7 months ago
Totally agree with A and C!
TR
Trinidad 7 months ago
Wait, is D even a real method?
NA
Nan 8 months ago
I think B and E are also valid.
ST
Stephaine 8 months ago
Logging? I just use console.log() and hope for the best. Who needs fancy server-side logging anyway?
AN
Annita 8 months ago
Hmm, I was torn between B) gs.error() and C) gs.debug(), but I suppose those aren't the right choices here.
LA
Lai 9 months ago
Wait, there's no option for "gs.printToConsole()"? What is this, amateur hour?
DO
Donte 9 months ago
I thought D) gs.logError() was the way to go, but I guess I was mistaken.
KA
Kami 9 months ago
A) gs.log() and E) gs.info() are the correct answers.
CA
Candida 9 months ago
I believe gs.debug() is also used for logging, but I can't recall if it's the best choice for this question.
FE
Fernanda 9 months ago
I’m a bit confused about gs.logError()—is that a valid method? I feel like I’ve seen it somewhere.
DE
Desmond 9 months ago
I remember practicing a question like this, and I think gs.error() is definitely one of the methods we should choose.
SU
Suzan 10 months ago
Hmm, I think gs.debug() and gs.logError() sound like they could be valid options too. I'm going to review the logging documentation to make sure I have a solid understanding of all the available methods.
MA
Mattie 10 months ago
The key here is that the question is asking about a privately-scoped application, so I'm guessing the more generic logging methods like console.log() wouldn't apply. I'll focus on the gs.* methods listed.
RA
Rashida 10 months ago
I'm a little confused by this question. Are there any other logging methods I should be aware of besides the ones listed? I want to make sure I don't miss anything.
EL
Elke 10 months ago
I think gs.log() and gs.info() are the main ones for general logging, but I'm not completely sure.
HU
Hubert 10 months ago
A and C are the ones!
LA
Laila 11 months ago
I think it's A and B.
VI
Virgilio 11 months ago
I remember using gs.error() a lot.
LA
Lavelle 11 months ago
Okay, I remember learning about these logging methods in class. I'm pretty confident that gs.log() and gs.info() are the two correct answers here.
SH
Sheron 11 months ago
Hmm, I think I've seen the gs.log() and gs.error() methods used for logging before, but I'm not sure about the others. I'll need to review my notes on server-side scripting.
JO
Josefa 6 months ago
↳ replying to Sheron
I think gs.logError() is also useful, but not as common.
LI
Lili 6 months ago
↳ replying to Sheron
Don't forget about gs.debug() for debugging messages!
DO
Douglass 6 months ago
↳ replying to Sheron
gs.error() is definitely a must for error logging.
CH
Chaya 6 months ago
↳ replying to Sheron
I usually go for gs.log() and gs.info().
MA
Marget 11 months ago
↳ replying to Sheron
Reviewing notes is a good idea! I need to brush up too.
0/2000 characters

Save Cancel