laravel中的HTTP异常和日志

HTTP异常

App::abort(‘404‘,‘Page not found‘);
App::abort(‘401‘,‘You are not authorized‘);
App::missing(function($exception){
  return  Response::view(‘errors.missing‘,array(),404);
});

7个日志级别debug、info、notice、warning、error、critical、alert

//
Log::info(‘This is some usefull information‘);
Log::warning("Somting could be going wrong");
Log::error(‘Somting is really going wrong‘);
Log::listen(function($level,$message,$context){

});
$monolog = Log::getMonolog();

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。