Bird
0
0

Which of the following is the correct way to set the log level to ERROR for the package org.myapp.service in application.yml?

easy📝 Conceptual Q2 of 15
Spring Boot - Logging
Which of the following is the correct way to set the log level to ERROR for the package org.myapp.service in application.yml?
Alogging: level: org.myapp.service: ERROR
Blogging.level.org.myapp.service=ERROR
Clog.level.org.myapp.service: ERROR
Dlogging.level.org.myapp.service: error
Step-by-Step Solution
Solution:
  1. Step 1: Recall YAML syntax for Spring Boot logging

    In application.yml, nested properties use indentation and colons, not equals signs.
  2. Step 2: Identify correct YAML structure

    The correct YAML for package-level log level is:
    logging: level: package.name: LEVEL
    logging: level: org.myapp.service: ERROR matches this format with correct casing and indentation.
  3. Final Answer:

    logging: level: org.myapp.service: ERROR -> Option A
  4. Quick Check:

    YAML uses indentation and colons for nested properties [OK]
Quick Trick: Use YAML indentation for nested logging.level settings [OK]
Common Mistakes:
  • Using equals sign in YAML
  • Wrong property name like log.level
  • Using lowercase for log level constants

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes