With this PHP IP Logging Snippet, it allows you to LOG the visitors IP address's which visit your website, and all you have to do is the following:
<?php
$v_ip = $REMOTE_ADDR;
$v_date = date("l d F H:i:s");
$fp = fopen("ips.txt", "a");
fputs($fp, "IP: $v_ip - DATE: $v_date\n\n");
fclose($fp);
?>