Since not all of us can get access to the server logs, how's about coding the error_log() calls using variables defined at the to of the script, so that users can set up logging to a file if required?
Regards
Paul
Since not all of us can get access to the server logs, how's about coding the error_log() calls using variables defined at the to of the script, so that users can set up logging to a file if required?
Regards
Paul
This work by Andrew M. Riley is licensed under a Creative Commons Attribution 3.0 Unported License
Error Log parms
Hmm, I'll take a look into it. The only thing that I'm not sure about trapping would be PHP errors themselves. Either way it's worth checking out.
-Andrew Riley
Error Log parms
Changing the way that locally defined log entries are reported has no bearing on error logs for PHP errors does it? Or am I missing something.
Here are the changes that I made:
// Define log stuff as an array to make it easier to add to "global" entries
$error_log_array = array(
'log_header'=>"[PHPFormMail]\t" . getenv('REMOTE_ADDR') . "\t" . getenv('HTTP_REFERER') . "\t" . date('Y-m-d H:i:s (T)') . "\t",
'log_option'=>3,
'log_destination'=>'mel/article.log',
'log_extras'=>'',
'log_newline'=>"\r\n",
'log_tab'=>"\t");
Each log line now looks like this:
error_log( $error_log_array['log_header'] . '>Illegal Referer>' . $error_log_array['log_newline'] , $error_log_array['log_option'], $error_log_array['log_destination'], $error_log_array['log_extras']);
Common headers mean that all log entries for a particular transaction can be grouped.