Bird
0
0

You want to set different log levels for two subpackages: com.example.api to DEBUG and com.example.api.internal to ERROR. Which configuration in application.properties achieves this?

hard📝 component behavior Q8 of 15
Spring Boot - Logging
You want to set different log levels for two subpackages: com.example.api to DEBUG and com.example.api.internal to ERROR. Which configuration in application.properties achieves this?
Alogging.level.com.example.api=DEBUG logging.level.com.example.api.internal=ERROR
Blogging.level.com.example.api.internal=ERROR logging.level.com.example.api=DEBUG
Clogging.level.com.example.api=ERROR logging.level.com.example.api.internal=DEBUG
Dlogging.level.com.example.api.internal=DEBUG logging.level.com.example.api=ERROR
Step-by-Step Solution
Solution:
  1. Step 1: Understand package-level specificity

    More specific package settings override less specific ones.
  2. Step 2: Assign correct levels to each package

    Set com.example.api to DEBUG and its subpackage com.example.api.internal to ERROR.
  3. Final Answer:

    logging.level.com.example.api=DEBUG logging.level.com.example.api.internal=ERROR -> Option A
  4. Quick Check:

    More specific package log level overrides parent [OK]
Quick Trick: Set parent and child package log levels separately [OK]
Common Mistakes:
  • Reversing log levels for parent and child packages
  • Using wrong package names
  • Assuming order of lines matters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes