$REQUEST_URI gets the page requested
$REMOTE_ADDR gets the User IP address.
$HTTP_REFERER gets the referer(the page the user came from)
$HTTP_USER_AGENT gets the Operating system and the browser the user is using.
You can just write these information to a file along with the $username variable and WHOA! u have a log file.
If you need any help, feel free to email me.