当前位置:网站首页>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 {
// ...
}边栏推荐
- 生产力工具和插件
- Talk about the message display mechanism on the SAP product UI
- STM32——软件SPI控制AD7705[通俗易懂]
- All-round visual monitoring of the Istio microservice governance grid (microservice architecture display, resource monitoring, traffic monitoring, link monitoring)
- 集群的安全模式
- networkx绘制度分布
- ICML2022 | 面向自监督图表示学习的全粒度自语义传播
- The importance of strategic offensive capability is much higher than strategic defensive capability
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
- centos7安装mysql5.7
猜你喜欢

Centos7 install mysql5.7 steps (graphical version)

Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"

NPM 使用介绍

ICML2022 | Fully Granular Self-Semantic Propagation for Self-Supervised Graph Representation Learning

PyQt5快速开发与实战10.2 复利计算 && 10.3 刷新博客点击量

IDEA can't find the Database solution

Google Chrome(谷歌浏览器)安装使用

Invalid bound statement (not found)出现的原因和解决方法

PartImageNet物体部件分割(Semantic Part Segmentation)数据集介绍

C#高级--委托
随机推荐
IDEA找不到Database解决方法
C# control ListView usage
PyQt5快速开发与实战 9.7 UI层的自动化测试
FastAPI 封装一个通用的response
清除浮动的四种方式及其原理理解
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
C#控件ListView用法
The use of C# control CheckBox
CentOS7 - yum install mysql
Network layer key protocol - IP protocol
操作符详解
A detailed explanation of the usage of Async and Await in C#
Introduction to the PartImageNet Semantic Part Segmentation dataset
[RPI]树莓派监控温度及报警关机保护「建议收藏」
NameNode故障处理的两种方法
基于改进YOLOv5的轻量化航空目标检测方法
网络层重点协议——IP协议
FastAPI encapsulates a generic response
golang-gin - graceful restart
ECCV2022:在Transformer上进行递归,不增参数,计算量还少!