Complete the code to create a logger instance in a Spring Boot class.
private static final Logger logger = LoggerFactory.[1](MyClass.class);
The LoggerFactory's getLogger method is used to create a logger instance for the class.
Complete the code to import the Logger class from the correct package.
import org.slf4j.[1];
The Logger interface is imported from org.slf4j.Logger.
Fix the error in the logger declaration by completing the code.
private static final Logger logger = LoggerFactory.getLogger([1]);The getLogger method requires a Class object, so MyClass.class is correct.
Fill both blanks to correctly declare and import the logger in a Spring Boot class.
import org.slf4j.[1]; private static final Logger [2] = LoggerFactory.getLogger(MyService.class);
The Logger interface is imported, and the logger instance is commonly named logger.
Fill all three blanks to complete the logger declaration with import and usage in a method.
import org.slf4j.[1]; private static final Logger [2] = LoggerFactory.getLogger(AppController.class); public void start() { [3].info("Application started"); }
Import the Logger interface, name the logger variable logger, and use it to log info messages.