0
0
Spring Bootframework~10 mins

Package-level log configuration in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the log level for a package in application.properties.

Spring Boot
logging.level.[1]=DEBUG
Drag options to blanks, or click blank then click option'
Aspring.datasource
Broot
Cserver.port
Dcom.example.myapp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'root' instead of the package name for package-level logging.
Confusing server or datasource properties with logging configuration.
2fill in blank
medium

Complete the code to set the log level to WARN for the package 'org.springframework.web'.

Spring Boot
logging.level.[1]=WARN
Drag options to blanks, or click blank then click option'
Aorg.springframework.boot
Borg.springframework.web
Corg.hibernate
Dorg.apache.catalina
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing unrelated packages like org.hibernate or org.apache.catalina.
Using the boot package instead of the web package.
3fill in blank
hard

Fix the error in the YAML configuration to set DEBUG level for 'com.example.service'.

Spring Boot
logging:
  level:
    [1]: DEBUG
Drag options to blanks, or click blank then click option'
Acom.example.service
Bcom.example.controller
Ccom.example.repository
Dcom.example
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong package name that does not match the service layer.
Incorrect indentation or key names in YAML.
4fill in blank
hard

Fill both blanks to configure package-level logging in application.properties for 'com.app' at INFO and 'com.app.db' at ERROR.

Spring Boot
logging.level.[1]=INFO
logging.level.[2]=ERROR
Drag options to blanks, or click blank then click option'
Acom.app
Bcom.app.db
Ccom.application
Dcom.database
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up package names or using incorrect names.
Setting the same level for both packages instead of different levels.
5fill in blank
hard

Fill all three blanks to create a YAML snippet setting log levels: 'com.app' to DEBUG, 'com.app.api' to INFO, and 'com.app.api.v1' to WARN.

Spring Boot
logging:
  level:
    [1]: DEBUG
    [2]: INFO
    [3]: WARN
Drag options to blanks, or click blank then click option'
Acom.app
Bcom.app.api
Ccom.app.api.v1
Dcom.application.api
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect package names or wrong order.
Confusing the indentation or YAML syntax.