Jump to content


This topic is now archived and is closed to further replies.


internal ip logging

Recommended Posts

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:


Assuming that internal IP's will be of the 192.168.xxx.xxx type, I believe something like this would work:


SetEnvIf Remote_Addr ^192\.168\. internal_IP
CustomLog logs/access.log combined env=!internal_IP


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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.