Bird
0
0

After configuring logging.pattern.file=%d{HH:mm:ss} %-5level %msg%n, your log file entries lack timestamps. What should you verify first?

medium📝 Debug Q7 of 15
Spring Boot - Logging
After configuring logging.pattern.file=%d{HH:mm:ss} %-5level %msg%n, your log file entries lack timestamps. What should you verify first?
AThat the log level is set to DEBUG
BThat the console pattern is set to include timestamps
CThat the logging file appender is enabled and uses the pattern
DThat the application.properties file is in the classpath
Step-by-Step Solution
Solution:
  1. Step 1: Confirm file appender usage

    Even if the pattern is set, if the file appender is not enabled or configured to use it, timestamps won't appear.
  2. Step 2: Console pattern irrelevant for file logs

    Console pattern does not affect file output.
  3. Step 3: Log level affects message filtering, not timestamp display

    Incorrect log level won't remove timestamps.
  4. Step 4: application.properties location is important but usually not the cause if logs appear

    If logs exist but lack timestamps, config is partially applied.
  5. Final Answer:

    That the logging file appender is enabled and uses the pattern -> Option C
  6. Quick Check:

    File appender must be active and use the pattern [OK]
Quick Trick: File appender must be active to apply file log pattern [OK]
Common Mistakes:
  • Checking console pattern instead of file appender
  • Assuming log level affects timestamp display
  • Ignoring appender configuration

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes