php error log thrown

<?php

// ini_set('display_errors', 'on');
// error_reporting(E_ALL|E_STRICT);

the error_reporting (0);
// Error Error Exception class takeover
class the App {
public function the __construct () {
$ this-> ISERR ();
}

ISERR function public () {
the set_exception_handler ([$ the this, 'EX']);
the set_error_handler ([$ the this, 'ERR']);
// end script calls RSF
register_shutdown_function ([$ the this, 'RSF']);

}

public function rsf () {
$ is error_get_last = ();
if (in_array ($ is [ 'type'], [1,4,16])) {
$ this-> errorlog ($ is [ 'type'], is $ [ 'message'], is $ [ 'File' ] $ is [ 'line']);
}
}

/ **
* took exception
* /
public function EX (EX $) {
$ = $ MSG EX-> the getMessage ();
$ $ EX- type => the getCode ();
$ File = $ EX-> the getFile ();
$ EX- = $ line> getline ();
// echo 'type:'. $ type 'message:' $ msg 'position:' $ file 'error line:'...... $ line;
$ this-> errorlog ($ type, $ MSG, File $, $ Line);
}

/ **
* Gets the error message
* /
public function ERR ($ of the type, $ msg, $ File, $ Line) {
// echo 'type:' $ type 'message:'.. $ Msg 'Location:'... . $ file 'error line:' $ line;.
$ this-> errorlog ($ type, $ MSG, File $, $ line);
}


/ **
* Log error
* /
public function errorlog ($ type, $ MSG, File $, $ Line) {
$ = DATE The errstr ( 'Ymd H: I: S', Time ()). "\ R & lt \ n-" ;
... $ errstr = 'error level' $ of the type "\ r \ the n-";
. $ errstr = 'wrong information' $ msg "\ r \ the n-";..
. $ errstr = 'error file' $ file. . "\ R & lt \ n-";
. The errstr $ = 'error line' $ line;.
. The errstr $ = '\ R & lt \ n-';
the error_log ($ The errstr,. 3, 'err.log');
}
}

new App();
// include ('err.php');
echo $s;
// echo $app->iserr();
// throw new Exception("Error Processing Request", 500);

Guess you like

Origin www.cnblogs.com/ayanboke/p/11026467.html