Bird
0
0

Which of the following is the correct way to enable file-based logging in application.properties?

easy📝 Syntax Q12 of 15
Spring Boot - Logging
Which of the following is the correct way to enable file-based logging in application.properties?
Alogging.filepath=logs/app.log
Blogging.file.name=logs/app.log
Clog.file=logs/app.log
Dlogging.pathfile=logs/app.log
Step-by-Step Solution
Solution:
  1. Step 1: Recall Spring Boot logging property names

    The correct property to set the log file name is logging.file.name.
  2. Step 2: Check each option for correctness

    Only logging.file.name=logs/app.log uses the exact property logging.file.name with a valid file path.
  3. Final Answer:

    logging.file.name=logs/app.log -> Option B
  4. Quick Check:

    Correct property for log file name = logging.file.name [OK]
Quick Trick: Use logging.file.name to set log file path [OK]
Common Mistakes:
  • Using incorrect property names like logging.filepath
  • Misspelling property keys
  • Confusing logging.file.name with logging.pathfile

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes