Don't log 404 errors in error log |
On our live site we get a lot of 404 errors from our site been probed by bots looking for phpMyAdmin/wordpress etc. This is filling up our log files with loads of "404 Page Not Found: Phpmyadmin2015/index" etc.
What's the best way to stop any 404 errors being logged into our log files? Many thanks!
I assume you are talking about the logs that CodeIgniter creates and not server or php logs.
Perhaps the least hackish way would be to extend the core class CI_Exceptions and override the method show_404. All the override has to do is call the parent method setting the second parameter to false. The whole class definition is simple. /application/core/MY_Exceptions.php PHP Code: class MY_Exceptions extends CI_Exceptions The hack way to accomplish your goal is to modify CodeIgniter.php and change line 494 (version 3.1.6) from PHP Code: show_404($RTR->directory.$class.'/'.$method); PHP Code: show_404($RTR->directory.$class.'/'.$method, FALSE); |
Welcome Guest, Not a member yet? Register Sign In |