CodeIgniter Forums
"404 Page Not Found --> images" in log file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: "404 Page Not Found --> images" in log file (/showthread.php?tid=53556)



"404 Page Not Found --> images" in log file - El Forum - 07-29-2012

[eluser]ojcarga[/eluser]
Hi there

I have just realized that my app is getting this error in the error log file /application/log/ ... i haven´t found anything about it that is why i´m asking.

Is there a way i can trace the point where that error is?

Just nosing around it, trying to figure it out.

Cheers!


"404 Page Not Found --> images" in log file - El Forum - 07-30-2012

[eluser]summanerd[/eluser]
Depends on where you want to see the error. The simplest & quickest way I do it is using PHP's stack trace like so (taken from PHP manual):

Code:
try {
test();
} catch(Exception $e) {
var_dump($e->getTrace());
}

If you want to see it in your logs instead of on the screen I use CI's log function and jsonencode the results of the stack trace.

Code:
try {
test();
} catch(Exception $e) {
log_message("error", json_encode($e->getTrace()));
}

The second option can remain in the code, but the first will need to be removed after testing is complete.

Let me know if this makes sense.