An alternate to getenv is $_SERVER['REMOTE_ADDR'];
I like to record as much data from the client as possible, so you might want to record other stuff like DNS, user agent, referrer, client's connection port (not usefull unless you have a hacker connecting and you want to see what port he/she's using)... and there are some more. here's the manual page:
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server
-sridhar