Apache Log files
Posted: Thu May 08, 2003 4:43 am
I'm trying to create my own log files, equivalent to the Apache ones using PHP.
I need to create the format:
The only two values I'm missing are 200 (the Status Code) and 1234 (the size of the object returned to the client). Is there anyway of getting these variables from PHP? Please help!
Thanks
Nunners
I need to create the format:
So far I've got this:62.161.78.75 - - [dd/mmm/yyyy:hh:mm:ss +0000] "GET / HTTP/1.1" 200 1234 "http://www.from.com/from.html" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
Code: Select all
echo($_SERVERї"REMOTE_ADDR"]." - - ї".DATE("d/M/Y:h:m:s +O")."] "".$_SERVERї"REQUEST_METHOD"]." / ".$_SERVERї"SERVER_PROTOCOL"]."" 200 1234 "http://".$_SERVERї"SERVER_NAME"]."".$_SERVERї"SCRIPT_NAME"]."" "".$_ENVї"HTTP_USER_AGENT"].""");Thanks
Nunners