user1547410
user1547410

Reputation: 893

Phalcon How to enable more detailed logging?

I am getting an error trying to display a new page i setup. It gives a message "Internal error" which is configured in my errors controller:

public function show500Action()
{
    \Phalcon\Tag::setTitle('Internal Error - '.SKIN_NAME);
}

Normally my error and access log display errors fine but from time to time it doesnt display anything. I am guessing there might be different levels of error logging but im not sure how to set that.

using

echo "test";
die();

In various parts of the code and managed to narrow down the error to a line:

$user = AdminUser::find(array("order" => "name_admin"));

So i tried this but i still dont get an error

try {
        $user = AdminUser::find(array("order" => "name_admin"));
    } catch(Exception $e) {
        echo 'Message: ' .$e->getMessage();
    }

Even if the try/catch worked im sure there is a way to make it write the error to the log like other logs rather than having to narrow down the error and do a try catch every time

There is a model called AdminUser and the corresponding database table adminUser so i cant figure out where the error is coming from

Upvotes: 1

Views: 1109

Answers (1)

Nicholas Charbonneau
Nicholas Charbonneau

Reputation: 175

I had a similar error a couple of weeks back. After querying with a model php would get an error but log absolutely nothing and I was never able to log it in the end.

In my case, it was due to an invalid namespace usage. You could attempt to test if the class exists to check that. If it does not I would say there's an incorrect auto-loading of the model's namespace where your loader registers namespaces and/or the usage call at the top of the script is incorrect.

Hope that helps!

Upvotes: 2

Related Questions