Welcome Guest, Not a member yet? Register   Sign In
404 Errors logging
#1

[eluser]danijelb[/eluser]
Hello,

I have a Errors_404 table in my db. I want to populate it with data about 404 errros, like IP of the user, time, and URL that caused 404.

I made a model, but I can't use that model in 404 template. How should I do this?

Thanks in advance.
#2

[eluser]n0xie[/eluser]
You could just hijack the 404 function to load a controller which does have access to a model and then log it there. It can be easily done by extending the Router Class.
#3

[eluser]CroNiX[/eluser]
http://maestric.com/doc/php/codeigniter_404

Thats a good custom 404 handler for ci. You could easily log using this since you have access to global CI object unlike the default 404.
#4

[eluser]Aken[/eluser]
You can also use PHP directly in the 404 error file. You can't use the CI super variable, so any DB manipulation you'd have to write stand-alone.




Theme © iAndrew 2016 - Forum software by © MyBB