Bird
0
0

Which application.properties configuration is correct?

hard📝 component behavior Q9 of 15
Spring Boot - Logging
Consider a Spring Boot application where you want to log WARN and ERROR messages for com.example.service but DEBUG and above for com.example.controller. Which application.properties configuration is correct?
Alogging.level.com.example.service=DEBUG\nlogging.level.com.example.controller=WARN
Blogging.level.com.example.service=WARN\nlogging.level.com.example.controller=DEBUG
Clogging.level.com.example.service=ERROR\nlogging.level.com.example.controller=INFO
Dlogging.level.com.example.service=INFO\nlogging.level.com.example.controller=TRACE
Step-by-Step Solution
Solution:
  1. Step 1: Set service package to WARN

    Use logging.level.com.example.service=WARN to log WARN and ERROR only.
  2. Step 2: Set controller package to DEBUG

    Use logging.level.com.example.controller=DEBUG to log DEBUG and above.
  3. Final Answer:

    logging.level.com.example.service=WARN\nlogging.level.com.example.controller=DEBUG -> Option B
  4. Quick Check:

    Service WARN and Controller DEBUG set correctly [OK]
Quick Trick: Set each package log level to desired minimum level [OK]
Common Mistakes:
  • Swapping levels between packages
  • Using INFO instead of DEBUG
  • Setting ERROR instead of WARN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes