PHP:将所有error_log文件合并到一个文件中 [英] PHP: merge all error_log files in to a single file

查看:77
本文介绍了PHP:将所有error_log文件合并到一个文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以编辑php.ini文件(或其他任何文件)并将所有* php_log *文件合并到单个php_log文件中,而不是每个目录中合并一个文件?

Is it possible to edit the php.ini file (or anything else) and have all the *php_log* files be merged in to a single php_log file instead of one per directory?

对于那些实际上没有读过的人的澄清:扫描目录中的文件类型并合并文件是两个非常不同的动作,答案截然不同。显然,重复记者从来没有问过关于这个话题的两个问题。 > __>

Clarification for those who don't actually read: scanning a directory for a file type and merging files are two VERY separate actions with very different answers. Apparently the dup reporters NEVER asked two questions about a topic ever. >__>

推荐答案

您要从中查找 error_log 指令 php .ini 文件。

You're looking for the error_log directive from the php.ini file.

该值必须是您希望记录错误的文件的绝对路径。如果是相对的,PHP会在脚本存在的目录(出现错误的目录)中创建该文件。这可能是每个目录中都有error_logs的原因:)

The value must be an absolute path to the file where you wish the errors to be logged. If it's relative, PHP will create that file in the directory where the script exists (the one in which the error came up). That's probably the reason why you have error_logs in each directory :)

作为副节点,如果您无权访问配置文件,则它为可以在运行时更改此设置。类似于 ini_set(‘error_log’,__DIR__。‘/ errors’); 在您的index.php脚本中

As a side node, if you don't have access to the configuration file, it's possible to change this setting at runtime. Something like ini_set('error_log', __DIR__ . '/errors'); in your index.php script

这篇关于PHP:将所有error_log文件合并到一个文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆