Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce CCM-101 Exam - Topic 9 Question 61 Discussion

Posted by Xenia on Mar 05, 2025 at 02:25 AM

Business Manager has the configuration:

* Active Log category is "root"

* Log level of WARN

The code below is executing:

var log = Logger.getLogger(''products'');

Using this information, what will be written to the log?

Suggested Answer: C

Get Premium CCM-101 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
34 comments · newest first
AU
Audry 11 months ago
Totally with you on A, that makes the most sense!
SH
Shaun 11 months ago
Definitely A, both messages should show up.
KA
Karan 11 months ago
I think B is correct, but not sure about the info message.
RE
Refugia 11 months ago
Wait, why would log.info even be considered here?
GA
Gabriele 11 months ago
Only WARN and ERROR messages will be logged.
BU
Bulah 12 months ago
I feel like I might be mixing up the log levels. I know WARN should log WARN and ERROR, but I can't remember if INFO is included. A seems likely, but I’m not completely confident.
TH
Thora 12 months ago
I practiced a similar question, and I think only the WARN and ERROR messages would be captured. A seems like the right choice, but I'm still a bit confused.
EL
Ellen 1 year ago
I'm not entirely sure, but I think INFO messages won't be logged at all since the level is set to WARN. So, B and C might not be correct.
IV
Ivette 1 year ago
I remember that with the log level set to WARN, only WARN and ERROR messages should be logged. So, I think A is a possibility.
MA
Marya 1 year ago
I've got a strategy for this. Since the log level is set to WARN, only messages at the WARN level or higher (i.e., ERROR) will be logged. So the answer should be A - both the WARN and ERROR messages will be written to the log.
KI
King 1 year ago
I'm a bit confused on this one. The code is using the "products" logger, but the active log category is "root". Does that mean the "products" logger will still be affected by the "root" log level? I'll need to double-check the logging framework documentation.
MI
Mitzie 1 year ago
Okay, let's see here. The active log category is "root" and the log level is set to WARN. So I'm thinking only the warn and error messages will be logged, not the info message.
MA
Malcom 1 year ago
Hmm, this looks like a tricky one. I'll need to carefully consider the log level and category settings to figure out what gets written.
CA
Carmen 2 years ago
Ah, I see what's going on here. Since the log level is set to WARN, the 'log.warn' message will be written, but the 'log.error' message will be suppressed. So the answer is A.
JE
Jeff 2 years ago
↳ replying to Carmen
Correct! The answer is A, as only the 'log.warn' message will be written to the log.
CE
Celeste 2 years ago
↳ replying to Carmen
That's right! The 'log.error' message will be suppressed because it is below the WARN level.
EM
Emogene 2 years ago
↳ replying to Carmen
Exactly! The log level is set to WARN, so only the 'log.warn' message will be written.
MA
Maira 2 years ago
Haha, I bet the answer is C. Imagine the poor developer who has to debug this code, they're gonna be scratching their heads like 'Wait, why is the info message being logged instead of the warn message?'
BR
Brice 2 years ago
↳ replying to Maira
I agree, it's important to pay attention to the log configurations.
SH
Shala 2 years ago
↳ replying to Maira
Yeah, it does seem like a tricky situation for the developer.
MA
Malcom 2 years ago
↳ replying to Maira
I think you might be onto something with option C.
MA
Malinda 2 years ago
I think the answer is A because the log level is set to WARN, so both warn and error messages will be logged.
GA
Galen 2 years ago
I'm not sure, but I think the log level of WARN will only log warn messages.
DE
Dean 2 years ago
I disagree, I believe the answer is B.
GA
Gail 2 years ago
I think the answer is A.
SU
Sunshine 2 years ago
Wait, what? The code is using 'Logger.getLogger('products')', but the log level is set to 'root'. Shouldn't it be checking the log level for the 'products' logger instead? This is a tricky one.
CH
Chu 2 years ago
↳ replying to Sunshine
Wait, what? The code is using 'Logger.getLogger('products')', but the log level is set to 'root'. Shouldn't it be checking the log level for the 'products' logger instead?
JE
Jesus 2 years ago
↳ replying to Sunshine
B) log.error(`This is an error message`); AND log.info(`This is an info message`);
FR
France 2 years ago
↳ replying to Sunshine
A) log.warn(`This is a warn message`); AND log.error(`This is an error message`);
AR
Art 2 years ago
Well, the question states that the log level is set to WARN, so I would expect to see the 'log.warn' message, but not the 'log.error' message. I guess option A is the correct answer.
CE
Celia 2 years ago
↳ replying to Art
Let's go with option A then, it makes the most sense based on the configuration.
LA
Laurel 2 years ago
↳ replying to Art
I think option B is incorrect because it includes an 'error' message which won't be logged.
DO
Dong 2 years ago
↳ replying to Art
Yeah, the log level is set to WARN so only the 'log.warn' message will be written.
WE
Werner 2 years ago
↳ replying to Art
I agree, option A seems to be the correct answer.
0/2000 characters

Save Cancel