私は通常、変数を使用してイベントをログに記録し、シャットダウン関数を登録して終了ポイントで何をするかを決定します。
class flightRecoder {
var $data;
var $err;
function __constructor() {
$this->data=array();
}
function error($errno, $errstr, $errfile, $errline)
{
if ($this->err<$errno) {
$this->err=$errno;
}
$this->note("ERROR! $errno $errstr", $errfile, $errline);
}
function note($note, $infile, $atline) {
$this->data[]="$note in $infile at $atline";
}
function finish() {
if ($this->errno || rand(1,20)==19) {
....
}
}
}
$log=new flightRecorder();
register_shutdown_function(array($log, 'finish'));
set_error_handler(array($log, 'error'));
あなたの場合は、(致命的なエラーをキャッチするために) error_logging が有効になっていることを確認してから、 exit ステートメントの前にメモを挿入するだけです。