码迷,mamicode.com
首页 > Web开发 > 详细

laravel中的HTTP异常和日志

时间:2014-11-26 18:35:10      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   for   on   

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异常和日志

标签:style   blog   http   io   ar   color   sp   for   on   

原文地址:http://www.cnblogs.com/xueyuwyz/p/4123717.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!