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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.