Bird
0
0

You want to see detailed logs only for the com.example.repository package but keep the rest of the application logging at WARN level. Which application.properties configuration achieves this?

hard📝 Application Q15 of 15
Spring Boot - Logging
You want to see detailed logs only for the com.example.repository package but keep the rest of the application logging at WARN level. Which application.properties configuration achieves this?
Alogging.level.root=TRACE logging.level.com.example.repository=WARN
Blogging.level.root=WARN logging.level.com.example.repository=TRACE
Clogging.level.root=INFO logging.level.com.example.repository=ERROR
Dlogging.level.root=DEBUG logging.level.com.example.repository=INFO
Step-by-Step Solution
Solution:
  1. Step 1: Set global log level to WARN

    Set logging.level.root=WARN to limit logs globally to warnings and errors.
  2. Step 2: Override package log level to TRACE

    Set logging.level.com.example.repository=TRACE to get detailed logs only for that package.
  3. Final Answer:

    logging.level.root=WARN logging.level.com.example.repository=TRACE -> Option B
  4. Quick Check:

    Global WARN + package TRACE = detailed logs only there [OK]
Quick Trick: Set root level high, override package level low for details [OK]
Common Mistakes:
  • Setting root level too low, flooding logs
  • Overriding package with higher level than root
  • Confusing package and root property keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes