#native_company# #native_desc#

File based, custom logging Page 4

By John Starkey
on September 30, 2002

Full Source!
Here is the code in whole so that you may paste it in a file for demonstration purposes:


'/whatever.file';  // change this to a file the server can write to, and you can read

$date date('Y-m-d H:i:s (T)');




    if ( 
$errno == E_USER_NOTICE )


$err "$date - ".$_SERVER['REMOTE_ADDR']." - NOTICE: $errmsg in $filename on line $linenumn";





$fake_array 'test'// declare the variable with a string value;

if ( !in_array('Something'$fake_array ) ) // cause the faked array to throw an error


trigger_error("Look, you and I both know that wasn't an array",E_USER_NOTICE); 

"An error has been posted to $log_file";



Once you have pasted the above code into a file, you can open that file in your browser and it should
print an error to your log file, as well as echo “An error has been posted to /tmp/article.log” to
your browser. If this is not the case, there may be a permissions problem, or you may need to check
your syntax.