Bird
0
0

You want to reduce log noise by setting com.example.repository to WARN but keep com.example.repository.audit at DEBUG. How do you configure this in application.yml?

hard📝 component behavior Q9 of 15
Spring Boot - Logging
You want to reduce log noise by setting com.example.repository to WARN but keep com.example.repository.audit at DEBUG. How do you configure this in application.yml?
Alogging: level: com.example.repository.audit: WARN com.example.repository: DEBUG
Blogging: level: com.example.repository.audit: DEBUG com.example.repository: WARN
Clogging: level: com.example.repository: DEBUG com.example.repository.audit: WARN
Dlogging: level: com.example.repository: WARN com.example.repository.audit: DEBUG
Step-by-Step Solution
Solution:
  1. Step 1: Understand YAML indentation and order

    YAML uses indentation for nesting; order does not affect overrides.
  2. Step 2: Assign correct levels to packages

    Set com.example.repository to WARN and its subpackage com.example.repository.audit to DEBUG.
  3. Final Answer:

    logging: level: com.example.repository: WARN com.example.repository.audit: DEBUG -> Option D
  4. Quick Check:

    More specific package log level overrides parent [OK]
Quick Trick: Use YAML indentation for nested package log levels [OK]
Common Mistakes:
  • Swapping log levels between parent and child packages
  • Using equals sign in YAML
  • Misindenting YAML keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes