Complete the code to import the logging module in a Flask app.
import [1]
The logging module is used to configure logging in Python applications, including Flask.
Complete the code to set the logging level to DEBUG in a Flask app.
logging.basicConfig(level=[1])Setting the level to logging.DEBUG enables detailed debug messages in the logs.
Fix the error in the code to get the Flask app logger and set its level to INFO.
app_logger = app.[1]
app_logger.setLevel(logging.INFO)The Flask app's logger is accessed via app.logger.
Fill both blanks to configure a file handler for logging to 'app.log' with level WARNING.
file_handler = logging.FileHandler('[1]') file_handler.setLevel(logging.[2])
The file handler writes logs to 'app.log' and is set to capture warnings and above.
Fill all three blanks to add the file handler to the Flask app logger and set a formatter.
formatter = logging.Formatter('[1]') file_handler.setFormatter(formatter) app.logger.[2](file_handler)
The formatter defines the log message format. The file handler is added to the app logger using addHandler.