0
0
Spring Bootframework~10 mins

Log levels (TRACE, DEBUG, INFO, WARN, ERROR) 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 log an informational message using Spring Boot's Logger.

Spring Boot
logger.[1]("Application started successfully.");
Drag options to blanks, or click blank then click option'
Atrace
Binfo
Cerror
Dwarn
Attempts:
3 left
💡 Hint
Common Mistakes
Using error or warn for normal info messages.
2fill in blank
medium

Complete the code to log a warning message about low disk space.

Spring Boot
logger.[1]("Disk space is running low.");
Drag options to blanks, or click blank then click option'
Adebug
Binfo
Ctrace
Dwarn
Attempts:
3 left
💡 Hint
Common Mistakes
Using info or debug instead of warn for warnings.
3fill in blank
hard

Fix the error in the code to log a detailed trace message.

Spring Boot
logger.[1]("Entering method processData with parameters.");
Drag options to blanks, or click blank then click option'
Ainfo
Bdebug
Ctrace
Dwarn
Attempts:
3 left
💡 Hint
Common Mistakes
Using debug instead of trace for very detailed logs.
4fill in blank
hard

Fill both blanks to log an error message with an exception.

Spring Boot
logger.[1]("Failed to save data.", [2]);
Drag options to blanks, or click blank then click option'
Aerror
Bwarn
Cexception
Dex
Attempts:
3 left
💡 Hint
Common Mistakes
Using warn instead of error for exceptions.
Passing wrong variable name for exception.
5fill in blank
hard

Fill all three blanks to create a debug log that shows the user ID and action performed.

Spring Boot
logger.[1]("User [2] performed [3] action.");
Drag options to blanks, or click blank then click option'
Adebug
B{}
Clogin
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using info instead of debug for detailed logs.
Not using placeholders for variables.