Bird
0
0

You have this incorrect logging channel configuration in config/logging.php:

medium📝 Troubleshoot Q14 of 15
Laravel - Configuration and Environment
You have this incorrect logging channel configuration in config/logging.php:
'daily' => [
    'driver' => 'daily',
    'path' => storage_path('logs/laravel.log'),
    'days' => '7',
    'level' => 'info',
],
What is the error and how do you fix it?
AThe 'days' value should be an integer, not a string; change '7' to 7
BThe 'path' should not use storage_path helper; use a string path instead
CThe 'level' key is invalid for daily driver and should be removed
DThe 'driver' should be 'single' instead of 'daily'
Step-by-Step Solution
Solution:
  1. Step 1: Identify type error in 'days' key

    The 'days' key expects an integer number of days to keep logs, but it is given as a string '7'.
  2. Step 2: Correct the data type

    Change 'days' => '7' to 'days' => 7 to fix the type mismatch.
  3. Final Answer:

    The 'days' value should be an integer, not a string; change '7' to 7 -> Option A
  4. Quick Check:

    'days' must be integer, not string [OK]
Quick Trick: Numeric config values must be integers, not quoted strings [OK]
Common Mistakes:
  • Leaving numeric values as strings causes config errors
  • Removing valid keys like 'level' mistakenly
  • Changing driver unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes