← Quiz: Docs and Production: all 10 questions
Quiz: Docs and Production · Question 2 of 10
Which logging line follows best practice?
Which logging line follows best practice?
- A.System.out.println("Enrolled " + email);
- B.log.info("Enrolled " + email + " in " + courseId);
- C.log.info("Student {} enrolled in course {}", email, courseId);
- D.log.error("Enrolled ok");
Answer & explanation
Correct answer: log.info("Student {} enrolled in course {}", email, courseId);
Placeholders avoid building strings when the level is off, and INFO suits a business event.
Can you get the rest right without peeking?
Take the timed Quiz: Docs and Production quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →