CodeIgniter Forums
Echo url in error log file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Echo url in error log file (/showthread.php?tid=30641)



Echo url in error log file - El Forum - 05-21-2010

[eluser]df_phot[/eluser]
I've been loggin my errors for several weeks now and I consistently get a particular 404 error. I can't figure out where this bad URL is coming from and why it happens so frequently. Is there a way to have the error logs echo the URL of the page where it occurred at? If so, that would help tremendously. Thanks in advance for the help!


Echo url in error log file - El Forum - 05-21-2010

[eluser]tomcode[/eluser]
show_404() takes a parameter which is logged ...

Code:
show_404($this->uri->uri_string());



Echo url in error log file - El Forum - 05-21-2010

[eluser]df_phot[/eluser]
I did a search and found 'show_404' in 5 different files. Which one do I alter?


Echo url in error log file - El Forum - 05-21-2010

[eluser]tomcode[/eluser]
Well all of them ... and if You want to trace down the call :

Code:
show_404('show_404 #1 ' .$this->uri->uri_string()); // #2, #3 ...



Echo url in error log file - El Forum - 05-21-2010

[eluser]df_phot[/eluser]
Thanks for pointing me in the right direction. I guess I realized (after the fact) what I meant to ask. I meant to ask what the referring site is. Then I found <a href="http://ellislab.com/forums/viewthread/51610/">this thread</a> that shows how to do it. Thanks!