Bird
0
0

If you set logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss} %-5level %logger - %msg%n in Spring Boot, what will happen?

medium📝 component behavior Q5 of 15
Spring Boot - Logging
If you set logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss} %-5level %logger - %msg%n in Spring Boot, what will happen?
ALogs will be saved without timestamps
BFile logs will use the specified pattern for each log entry
CLogging will stop because the pattern is invalid
DConsole logs will use this pattern instead of file logs
Step-by-Step Solution
Solution:
  1. Step 1: Understand the property usage

    logging.pattern.file sets the log format for file output.
  2. Step 2: Confirm effect on logs

    File logs will follow the given pattern; console logs remain unchanged.
  3. Final Answer:

    File logs will use the specified pattern for each log entry -> Option B
  4. Quick Check:

    File log pattern property affects file logs only [OK]
Quick Trick: File pattern affects file logs, not console [OK]
Common Mistakes:
  • Thinking console logs change
  • Assuming invalid pattern
  • Ignoring timestamp in pattern

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes