Complete the code to import the logging module in FastAPI.
import [1]
The logging module is used to configure and use logging in FastAPI applications.
Complete the code to create a logger instance named 'app_logger'.
app_logger = logging.[1]('app_logger')
The getLogger function creates or retrieves a logger instance by name.
Fix the error in setting the logging level to INFO.
app_logger.setLevel(logging.[1])Logging levels are constants in uppercase, so INFO must be uppercase.
Fill both blanks to configure logging format and level using basicConfig.
logging.basicConfig(format=[1], level=logging.[2])
The format string defines the log message layout, and level sets the minimum severity to INFO.
Fill all three blanks to create a logger, set level to WARNING, and log a warning message.
logger = logging.[1]('my_logger') logger.setLevel(logging.[2]) logger.[3]('This is a warning!')
Use getLogger to create the logger, set level to WARNING, and call warning() to log a warning message.