Bird
0
0

Consider this application.yml snippet:

medium📝 Predict Output Q5 of 15
Spring Boot - Application Configuration
Consider this application.yml snippet:
logging:
  level:
    root: ${LOG_LEVEL:INFO}

If no environment variable LOG_LEVEL is set, what will be the logging level?
ADEBUG
BINFO
Cnull
D${LOG_LEVEL}
Step-by-Step Solution
Solution:
  1. Step 1: Analyze default value in YAML configuration

    The placeholder ${LOG_LEVEL:INFO} means use LOG_LEVEL env var or default to INFO if unset.
  2. Step 2: Apply absence of environment variable

    Since LOG_LEVEL is not set, the default INFO is used.
  3. Final Answer:

    INFO -> Option B
  4. Quick Check:

    Default used when env var missing = INFO [OK]
Quick Trick: Default value applies if env var is missing [OK]
Common Mistakes:
  • Expecting null or empty string instead of default
  • Confusing placeholder string as output
  • Assuming DEBUG is default without setting

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes