Uncaught ReflectionException: Class log does not exist Laravel 5.2
Okay, after many hours of digging, the solution for my problem has been found. The reason why I say my problem is because the Exception
is very mis-leading.
Uncaught ReflectionException: Class log does not exist
This exception simply means Laravel tried to log an error but couldn't instantiate Laravel's Log
class. This is not due to the Log class going walk-abouts or hiding. This is because Laravel is still going through its boot process & has yet to load the Log
class.
So, this exception is thrown because an error occurred during the boot cycle of Laravel - when this error occurred it tried to throw an exception - but it can't throw an exception because the Log
class is yet the be loaded. Hence the reason we get a ReflectionException
This has occurred in all versions of Laravel the only reason we have seen the exception thrown in laravel 5.1 <= is because previously Laravel silently discarded the problem & carried on through its boot process - basically, your app would still break however you would not receive the Log class exception
.
In my particular case I didn't have the php-mysql
extension installed causing Laravel to break during its boot process.
Ultimately, it is incredibly difficult to debug what you may have done wrong due to the error been very mis-leading.
I hope this helps someone!
EDIT: On how to debug this error and find out WHICH missing extension/component is actually causing the problem take a look at @Ben Johnson's answer.
Uncaught ReflectionException: Class log does not exist in /vendor/laravel/framework/src/Illuminate/Container/Container.php:738
As noodles_ftw says, this was a config file issue. so, checking for errors in my config folder did the trick, I had an error in jwt.php
Hope it helps!
Related Topics
How Does the "&" Operator Work in a PHP Function
Laravel Preg_Match(): No Ending Delimiter '/' Found
Setting the Timezone for PHP in the PHP.Ini File
Close Open HTML Tags in a String
iPhone Emoticons Insert into MySQL But Become Blank Value
How to Retrieve the Full Directory Tree Using Spl
Get a PHP Object Property That Is a Number
Grouping Where Clauses in Codeigniter
Truncate Float Numbers with PHP
Error While Using Pdo Prepared Statements and Limit in Query
How to Pass Variables Received in Get String Through a PHP Header Redirect
Read Large Data from CSV File in PHP
Magento Upgrade Takes Too Long and Never Completes
Why Should I Fix E_Notice Errors
How to Bind Parameters to a Raw Db Query in Laravel That's Used on a Model