0
0
Laravelframework~10 mins

Logging configuration in Laravel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the default log channel in Laravel's config.

Laravel
'default' => env('LOG_CHANNEL', '[1]'),
Drag options to blanks, or click blank then click option'
Adaily
Bstack
Csyslog
Dsingle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'single' instead of the default 'stack'.
Using 'daily' which rotates logs daily but is not default.
2fill in blank
medium

Complete the code to configure the daily log channel's maximum files.

Laravel
'daily' => [
    'driver' => 'daily',
    'path' => storage_path('logs/laravel.log'),
    'level' => 'debug',
    'days' => [1],
],
Drag options to blanks, or click blank then click option'
A7
B5
C10
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Setting 'days' to 30 which is longer than default.
Using 5 which is less than Laravel's default.
3fill in blank
hard

Fix the error in the logging config to correctly use the 'stack' channel.

Laravel
'stack' => [
    'driver' => '[1]',
    'channels' => ['single', 'daily'],
],
Drag options to blanks, or click blank then click option'
Astack
Bsingle
Cdaily
Dsyslog
Attempts:
3 left
💡 Hint
Common Mistakes
Setting driver to 'single' or 'daily' instead of 'stack'.
Using 'syslog' which is unrelated to stacking.
4fill in blank
hard

Fill both blanks to configure the syslog channel with the correct driver and level.

Laravel
'syslog' => [
    'driver' => '[1]',
    'level' => '[2]',
],
Drag options to blanks, or click blank then click option'
Asyslog
Berror
Cdebug
Dsingle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'single' as driver for syslog channel.
Setting level to 'error' instead of default 'debug'.
5fill in blank
hard

Fill all three blanks to create a custom log channel with daily driver, path, and warning level.

Laravel
'custom' => [
    'driver' => '[1]',
    'path' => storage_path('[2]'),
    'level' => '[3]',
],
Drag options to blanks, or click blank then click option'
Adaily
Blogs/custom.log
Cwarning
Dsingle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'single' driver instead of 'daily'.
Setting path to default laravel.log instead of custom path.
Using 'debug' level which is too verbose.