Bird
0
0

You want to log detailed trace information only for the package com.example.api while keeping the rest of the application at INFO level. Which configuration in application.properties achieves this?

hard📝 component behavior Q8 of 15
Spring Boot - Logging
You want to log detailed trace information only for the package com.example.api while keeping the rest of the application at INFO level. Which configuration in application.properties achieves this?
Alogging.level.root=TRACE\nlogging.level.com.example.api=INFO
Blogging.level.com.example.api=INFO\nlogging.level.root=TRACE
Clogging.level.root=INFO\nlogging.level.com.example.api=TRACE
Dlogging.level.root=DEBUG\nlogging.level.com.example.api=TRACE
Step-by-Step Solution
Solution:
  1. Step 1: Set global log level to INFO

    Use logging.level.root=INFO to keep most logs at INFO level.
  2. Step 2: Override package log level to TRACE

    Set logging.level.com.example.api=TRACE to get detailed logs only for that package.
  3. Final Answer:

    logging.level.root=INFO\nlogging.level.com.example.api=TRACE -> Option C
  4. Quick Check:

    Root INFO with package TRACE override works [OK]
Quick Trick: Set root level then override specific package [OK]
Common Mistakes:
  • Reversing root and package levels
  • Setting root to TRACE globally
  • Not overriding package level

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes