Jump to content

internal ip logging


tripstar1976

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:

http://www.serverwatch.com/tutorials/article.php/10825_3376671_2

Assuming 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_IP
CustomLog 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

Archived

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

×
×
  • Create New...

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.