当前位置:网站首页>CodeIgniter 打开错误日志
CodeIgniter 打开错误日志
2022-07-31 13:17:00 【fareast_mzh】
app/config/config.php
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| 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
|
| 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;默认0 不输出log, 4等级最高
app/logs/log-2022-07-29.php

输出日志用\log_message函数
log_message('error', "Unable to write cache file: ".$cache_path);system/core/Common.php

system/libraries/Log.php
/**
* Write Log File
*
* Generally this function will be called using the global log_message() function
*
* @param string the error level
* @param string the error message
* @param bool whether the error is a native PHP error
* @return bool
*/
public function write_log($level = 'error', $msg, $php_error = FALSE)
{
if ($this->_enabled === FALSE)
{
return FALSE;
}
$level = strtoupper($level);
if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
{
return FALSE;
}
$filepath = $this->_log_path.'log-'.date('Y-m-d').'.php';
$message = '';
if ( ! file_exists($filepath))
{
$message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n";
}
if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE))
{
return FALSE;
}
$message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n";
flock($fp, LOCK_EX);
fwrite($fp, $message);
flock($fp, LOCK_UN);
fclose($fp);
@chmod($filepath, FILE_WRITE_MODE);
return TRUE;
}CodeIgniter phpstorm自动补全
@property \CI_Input input
<?php
/**
* @property \MY_Loader load
* @property \CI_Input input
*/
class Common extends CI_Controller {
// ...
}边栏推荐
- Google Chrome(谷歌浏览器)安装使用
- Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
- MATLAB | 我也做了一套绘图配色可视化模板
- C# control StatusStrip use
- JSP中如何借助response对象实现页面跳转呢?
- Hard disk partition, expand disk C, no reshipment system, not heavy D dish of software full tutorial.
- 图像大面积缺失,也能逼真修复,新模型CM-GAN兼顾全局结构和纹理细节
- Four ways to clear the float and its principle understanding
- 文本相似度计算(中英文)详解实战
- NPM 使用介绍
猜你喜欢
![[CPU Design Practice] Simple Pipeline CPU Design](/img/83/e1dfedfe2b2cfe83a34f86e252caa7.jpg)
[CPU Design Practice] Simple Pipeline CPU Design

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法

深入浅出边缘云 | 4. 生命周期管理

ERROR 1819 (HY000) Your password does not satisfy the current policy requirements

A detailed explanation of the usage of Async and Await in C#

Introduction to the PartImageNet Semantic Part Segmentation dataset

浏览器被hao360劫持解决办法

C#获得网卡信息 NetworkInterface IPInterfaceProperties

golang八股文整理(持续搬运)

PartImageNet物体部件分割(Semantic Part Segmentation)数据集介绍
随机推荐
文本相似度计算(中英文)详解实战
365天挑战LeetCode1000题——Day 044 最大层内元素和 层次遍历
Four ways to clear the float and its principle understanding
浏览器被hao360劫持解决办法
C#高级--委托
Architecture Camp | Module 8
Install the latest pytorch gpu version
STM32——软件SPI控制AD7705[通俗易懂]
基于高阶微分器的无模型滑模控制器及其在自动电压调节器中的应用
如何使用StarUML画类图[通俗易懂]
MATLAB | 我也做了一套绘图配色可视化模板
PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
关于MySQL主从复制的数据同步延迟问题
C#中+=的用法
The latest complete code: Incremental training using the word2vec pre-training model (two loading methods corresponding to two saving methods) applicable to various versions of gensim
PyQt5快速开发与实战 9.7 UI层的自动化测试
SAP message TK 248 solved
Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"
Sliding window method to segment data
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法