Bird
0
0

Given the following application.properties settings:

medium📝 component behavior Q4 of 15
Spring Boot - Logging
Given the following application.properties settings:
logging.level.com.example=DEBUG
logging.level.com.example.service=ERROR

What will be the effective log level for the class com.example.service.UserService?
AWARN
BDEBUG
CINFO
DERROR
Step-by-Step Solution
Solution:
  1. Step 1: Understand package-level log level precedence

    More specific package settings override less specific ones.
  2. Step 2: Identify the most specific match for the class

    com.example.service.UserService matches both com.example and com.example.service, but com.example.service is more specific.
  3. Final Answer:

    ERROR -> Option D
  4. Quick Check:

    More specific package log level overrides general [OK]
Quick Trick: More specific package log level wins [OK]
Common Mistakes:
  • Assuming parent package level applies always
  • Ignoring more specific package settings
  • Confusing log levels order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes