Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel's log loggs empty errors

I'm attempting to deploy my Laravel application, however, I'm currently encountering difficulties. The site doesn't work properly, the page name is correctly displayed in the tab and the alt text of my loader.gif is displayed, however, nothing at all happens. Attempting to tackle this problem, I found out that Laravel logs empty errors:

-- needed pastebin since SO told me my code wasn't properly formatted (despite the code being perfect as it is) -- https://pastebin.com/S9vBg5aW

just like that. Each time I re-access the webpage the errors are expanded by a certain number of errors. I only recently upgraded from Laravel 5.5 to 5.6.

like image 895
Johnny Avatar asked Feb 19 '26 02:02

Johnny


1 Answers

Laravel 5.6 comes with different channels for logging.

in your .env

LOG_CHANNEL=stack

create a file in config/logging.php

paste the below given code.

<?php

return [



    'default' => env('LOG_CHANNEL', 'stack'),



    'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['single'],
        ],

        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
        ],

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'days' => 7,
        ],

        'slack' => [
            'driver' => 'slack',
            'url' => env('LOG_SLACK_WEBHOOK_URL'),
            'username' => 'Laravel Log',
            'emoji' => ':boom:',
            'level' => 'critical',
        ],

        'syslog' => [
            'driver' => 'syslog',
            'level' => 'debug',
        ],

        'errorlog' => [
            'driver' => 'errorlog',
            'level' => 'debug',
        ],
    ],

];

for More informations

https://laravel.com/docs/5.6/logging

Hope this helps

like image 178
Romantic Dev Avatar answered Feb 20 '26 21:02

Romantic Dev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!