Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Backtraking app errors
  • Hi,

    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).
  • Yes, it is on production server and this is an issue, cos I can't reporoduce some cases on dev and feature like this would be extremely usefull.
  • HarroHarro
    Accepted Answer
    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


  • Cool, thank you Harro!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion