Complete the code to set the logging file name in application.properties.
logging.file.name=[1]In Spring Boot, logging.file.name sets the log file name. Here, server.log is the correct example.
Complete the code to set the logging level to DEBUG in application.properties.
logging.level.root=[1]The logging.level.root property controls the root logging level. Setting it to DEBUG enables detailed logs.
Fix the error in the logback-spring.xml snippet to write logs to a file named app.log.
<appender name="FILE" class="ch.qos.logback.core.FileAppender"> <file>[1]</file> <encoder> <pattern>%d{yyyy-MM-dd HH:mm:ss} - %msg%n</pattern> </encoder> </appender>
The <file> tag must specify a file name, not a directory. app.log is a valid file name.
Fill both blanks to configure a rolling file appender with max file size 10MB and max history 5.
<rollingPolicy class="ch.qos.logback.core.rolling.[1]"> <maxFileSize>[2]</maxFileSize> <maxHistory>5</maxHistory> </rollingPolicy>
SizeBasedRollingPolicy rolls files based on size. Setting maxFileSize to 10MB limits each log file to 10 megabytes.
Fill all three blanks to create a log pattern with date, log level, and message.
<pattern>[1] - [2] - [3]</pattern>
The pattern includes date/time (%d{yyyy-MM-dd HH:mm:ss}), log level (%level), and the log message (%msg).