I'm recently trying to identify some issues with an app, or to be more specific - part of an app run from CLI.
Basically the error I get is like : Uncaught exception Fuel\Core\PhpErrorException: Array to string conversion
But there is no information about where it is happening. Full stack dump would be usefull, but:
- there is nothing logged in the server logs - also nothing in fuel's log - just a brief information on the console screen.
The question is : how to make fuel more verbose in this case ?
also, standard fuel's log entry looks like this:
ERROR - 2018-01-22 06:56:42 --> Undefined index: type but sometimes I get something like
ERROR - 2018-01-16 19:38:02 --> Notice - Undefined variable: 10000 in /var/www/vhost/fuel/app/modules/api/classes/controller/ext/v1/widgets.php on line 321
Can I somehow set it up to put more details into it? Why I'm getting 2 different levels of details with similar type of error on the same environment/app (it might be somehow relared to cli/http call but due to lack of info it is hard for me to trace back the issue).
In which environment does your CLI command run? I assume it is in "production", which doesn't provide detailed error messages (and there is no option to differentiate between CLI and HTTP).
I've looked in the code, but I don't see any logging in the error handler that doesn't also log the file and the line number (like in your second example), so I don't know where the "Undefinex index: type" comes from.
I did more digging and found that oil has it's own exception handler which catches and prints every exception. This is where the "Undefinex index: type" comes from. I've fixed this, so it now logs the same as errors in other parts of the code, and it now outputs:
Uncaught exception Fuel\Core\PhpErrorException: 8 - Array to string conversion in /data/www/vhosts/client/appname/app/tasks/test.php on line 12