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

php CI框架log写入

时间:2018-10-13 10:25:20      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:min   文件夹   including   levels   输入   log文件   out   color   evel   

1.首先,打开application下的config.php文件,将log配置打开如下

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
|    0 = Disables logging, Error logging TURNED OFF
|    1 = Error Messages (including PHP errors)
|    2 = Debug Messages
|    3 = Informational Messages
|    4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
|     array(2) = Debug Messages, without Error Messages
|
| For a live site you‘ll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config[‘log_threshold‘] = 4;

2.在控制器里面输入,并在浏览器打开该控制器

    public function get_payee_summary()
    {    
        log_message(‘info‘,‘log_test:log测试‘);
    }    

3.最后就能在application下的logs文件夹里面开到最近生成的log文件

php CI框架log写入

标签:min   文件夹   including   levels   输入   log文件   out   color   evel   

原文地址:https://www.cnblogs.com/aj407blogs/p/9781797.html

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