Laravel debugging after updates
hey guys, circling back to the previous thread about improving laravel error handling after updates. i'm kinda stuck on a deeper issue now that i've applied some of those tips. i recently upgraded our main app from laravel 8 to 10, and while most things are smooth, i'm running into super inconsistent exception logging, especially for things that feel like they're happening *before* laravel's main handler kicks in. it's driving me nuts trying to pinpoint some silent failures.
so, what i've tried so far is pretty standard: checked APP_DEBUG and APP_ENV, ensured our logging.php is configured for 'stack' and 'daily' logs, cleared all caches (config, cache, view, route), and even explicitly tried report() in some spots just to force an entry. i've been religiously watching storage/logs/laravel.log and also tailing php-fpm logs, and even hooked up sentry/bugsnag, but there are still gaps.
the problem is, some exceptions โ particularly those from background queue jobs, or sometimes even specific service provider boot errors during a request โ just *don't* show up in laravel.log. they might pop up as a generic 500 in the browser, or i'll see something vague in the php-fpm error logs, but no detailed stack trace from laravel's perspective. it's like they're being swallowed or handled at a lower level before the framework's exception handler gets a chance. this is a huge concern for production stability, as i'm probably missing critical errors.
i'm wondering, how do you guys ensure *all* php/laravel exceptions, especially those happening very early in the request lifecycle or within queue workers, are consistently logged? is there a particular php.ini directive or web server (nginx, in our case) configuration that might be prematurely handling or suppressing errors before laravel can proces them, especially after a major framework upgrade? i'm looking for advanced laravel debugging techniques for these "silent" failures. should i be looking at custom error handlers directly in bootstrap/app.php or even public/index.php to catch *everything*? how do you deal with situations where even report() isn't reliably logging? thanks in advance!
0 Answers
No answers yet.
Be the first to provide a helpful answer!