For older versions, where Aaron’s plugin may not work or somehow you can’t set it up, this basic thing is always there – logging to a file –
function log_msg( $s = "" ){
fileputcontents("qry.log", date("d-m-Y h:i:s a :=").$s."\n");
}
function fileputcontents($path,$string){
$error = false;
if(!($fp = fopen($path,'a'))){
$error = true;
}
if (fwrite($fp, $string) === FALSE) {
$error = true;
}
fclose($fp);
if($error){
return false;
}else{
return true;
}
}
note: the function name “fileputcontents” is just indicative that it is doing the same thing as the PHP 5 function file_put_contents(,,,FILE_APPEND);
It is very basic, so it is use-ful as well as feature-less.