There seems to be another situation that causes this EXACT SAME ERROR but for a different reason!
Here is how I solved this other cause:
I had the same error but there were NO spaces anywhere in the .env file.
putting everthing into double quotes did NOT help in my case
In my case the reason was a tiny mistake in the config/services.php (but error can be reproduced in any of the files within config/... it does not need to be a custom config file)
in my case it was a ']' instead of a ')' - but I have also seen this same error with missing ',' (=comma) at line-end.
Very confusing as it is very hard to trace down from 'log' (which is probably from config/app.php in this small-letter notation in contrast to 'Log' in other places with a capital 'L')
Hope this m ight be of help to someone, too.