0
0
Spring Bootframework~20 mins

Package-level log configuration in Spring Boot - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spring Boot Logging Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
Understanding package-level log output in Spring Boot
Given the following Spring Boot logging configuration, what will be the log level for classes in the package com.example.service?
Spring Boot
logging.level.com.example=INFO
logging.level.com.example.service=DEBUG
logging.level.com.example.repository=ERROR
AERROR
BINFO
CDEBUG
DWARN
Attempts:
2 left
💡 Hint
Remember that more specific package settings override broader ones.
📝 Syntax
intermediate
2:00remaining
Identify the correct YAML syntax for package-level logging
Which of the following YAML snippets correctly sets the log level to WARN for the package org.project.module in Spring Boot?
Alogging.level.org.project.module = WARN
B
NRAW :eludom.tcejorp.gro    
:level  
:gniggol
C
logging:
  level:
    org.project.module: "WARN"
D
logging:
  level:
    org.project.module: WARN
Attempts:
2 left
💡 Hint
YAML uses indentation and colons, not equal signs.
🔧 Debug
advanced
2:00remaining
Why does the package-level log configuration not apply?
You set logging.level.com.example=DEBUG in application.properties, but logs from com.example.controller still show at INFO level. What is the most likely cause?
AThere is a more specific log level set for <code>com.example.controller</code> overriding DEBUG
BThe logging framework does not support package-level configuration
CThe log level DEBUG is not a valid level and defaults to INFO
DThe <code>application.properties</code> file is not loaded by Spring Boot
Attempts:
2 left
💡 Hint
Check if any other configuration overrides the package level.
state_output
advanced
2:00remaining
Resulting log level after multiple package-level settings
Given these settings in application.properties:
logging.level.com=ERROR
logging.level.com.example=INFO
logging.level.com.example.sub=DEBUG
What is the effective log level for a class in com.example.sub.module?
AINFO
BDEBUG
CWARN
DERROR
Attempts:
2 left
💡 Hint
The most specific package-level setting applies.
🧠 Conceptual
expert
2:00remaining
Why use package-level log configuration in Spring Boot?
Which of the following is the best reason to use package-level log configuration instead of class-level logging in Spring Boot?
AIt allows controlling log verbosity for groups of classes easily without changing each class individually
BIt improves application performance by disabling logging completely
CIt automatically formats log messages with package names
DIt enables logging to external systems without code changes
Attempts:
2 left
💡 Hint
Think about managing many classes at once.