Complete the code to log an info message in a Spring Boot application.
logger.[1]("Application started successfully.");
The info method logs informational messages, which are useful for general application events like startup.
Complete the code to create a logger instance in a Spring Boot class.
private static final Logger logger = LoggerFactory.[1](MyApplication.class);
The getLogger method from LoggerFactory creates a logger for the given class.
Fix the error in the logging statement to correctly log an error message with an exception.
logger.[1]("Failed to process request", e);
The error method is used to log error messages along with exceptions.
Fill both blanks to log a warning message only if the variable 'user' is null.
if ([1] == null) { logger.[2]("User object is null"); }
Check if user is null, then log a warning with warn method.
Fill all three blanks to create a log message with the user's name and age using placeholders.
logger.[1]("User {} is {} years old", [2], [3]);
Use info to log the message, and pass userName and userAge as parameters for placeholders.