Welcome Guest, Not a member yet? Register   Sign In
Debugging and misleading 404 messages
#1

[eluser]koorb[/eluser]
Ok, so I do have a problem with the poor debugging messages from CI. But that's a little beside the point of this topic. I do love CI I use it all the time. I have extended the Log library so it's a little saner, more common logging format and logging to just *one file*!

But the thing that really causes me problems at the moment is the debug logging around routes. So I get a debug message "Router Class Initialized" and an error message "404 Page Not Found -->" and that's all. So whether I'm using simple routes or regex it's very hard to see what the problem is, what exactly is the "-->" in that error message? It would really help if that error included exactly which controller it couldn't find. It would also help if the debugging included the actual request segments and the routed segments so you could see better what CI was trying to do with your routes. "Router Class Initialized" is useful for developers of CI but developing apps with CI that's not especially useful information.

Along with that though is that a 404 error is logged even if the controller is there but there is some errors within the method, it is very misleading. Why does that happen?

Sorry to moan, I do love CI :-)
#2

[eluser]Mirage[/eluser]
A quick stab in the dark here... The router load the controller if it's found. If there are errors in the controller, the router won't be able to test for the method and therefore fails. If the router fails - it says it couldn't find the page.

Understandably, you'd like a better trace of where you are in the process when it fails. Other than plugging the Router class with debug messages, this is unfortunately something that isn't so easily doable in PHP4. If this was PHP5, then a caught exception could make an effort to output a better trace to the point of failure.

Cheers!
#3

[eluser]Derek Jones[/eluser]
As a side note, since sometime in mid-February in the svn, all 404 log messages include the controller and method attempting to be called.
#4

[eluser]bradym[/eluser]
@Derek: Awesome! Will this be included in the next release version of CI?
#5

[eluser]Derek Jones[/eluser]
Yep, anything committed to the SVN will under normal circumstances be part of the next official version release.
#6

[eluser]bradym[/eluser]
That's what I figured, glad to have it confirmed. Thanks Derek!




Theme © iAndrew 2016 - Forum software by © MyBB