tripstar1976 Posted September 7, 2006 Share Posted September 7, 2006 HiIs there any way to stop internal/network ips from being logged?Thanks Link to comment https://forums.phpfreaks.com/topic/19972-internal-ip-logging/ Share on other sites More sharing options...
R_P Posted September 7, 2006 Share Posted September 7, 2006 Yep, the buzz words you need to search for here are: conditional logging in apache. Here's a great reference. It uses apache mod_setenvif by the way:http://www.serverwatch.com/tutorials/article.php/10825_3376671_2Assuming that internal IP's will be of the 192.168.xxx.xxx type, I believe something like this would work:[code]SetEnvIf Remote_Addr ^192\.168\. internal_IPCustomLog logs/access.log combined env=!internal_IP[/code]What this basically does is instanciate an "internal_IP" environmental rule if the IP starts with "192.168." which is then evaluated after the custom log directive. If internal_IP exists, it will suppress logging. I actually do this with a number of my scripts called by AJAX. Comes in pretty handy.Have fun. Link to comment https://forums.phpfreaks.com/topic/19972-internal-ip-logging/#findComment-87544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.