首页 > 代码库 > laravel中的HTTP异常和日志

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();

 

laravel中的HTTP异常和日志