Method CommonLog.read()
- Method read
intread(function(array(int|string),int:void)callback,Stdio.File|stringlogfile,void|intoffset)- Description
Reads the log file and calls the callback function for every parsed line. For lines that fails to be parsed the callback is not called not is any error thrown. The number of bytes read are returned.
- Parameter
callback The callbacks first argument is an array with the different parts of the log entry.
Array stringremote_hostint(0..0)|stringident_userint(0..0)|stringauth_userintyearintmonthintdayinthoursintminutesintsecondsinttimezoneint(0..0)|stringmethodOne of "GET", "POST", "HEAD" etc.
int(0..0)|stringpathstringprotocolE.g. "HTTP/1.0"
intreply_codeOne of 200, 404 etc.
intbytesThe second callback argument is the current offset to the end of the current line.
- Parameter
offset The position in the file where the parser should begin.