是否可以将php.ini设置为使用多个错误日志?
我当前的php.ini是: 错误日志=错误日志 很好,它将所有脚本的错误记录到单独的文件中,具体取决于它们所在的文件夹。所以它给出了这样一个结果:是否可以将php.ini设置为使用多个错误日志?,php,Php,我当前的php.ini是: 错误日志=错误日志 很好,它将所有脚本的错误记录到单独的文件中,具体取决于它们所在的文件夹。所以它给出了这样一个结果: public_html/error_log public_html/folder1/error_log public_html/folder2/error_log 但除此之外,是否还可以将其记录到一个常规错误日志?像下面这样 public_html/general_error_log_for_all_folders public_html/erro
public_html/error_log
public_html/folder1/error_log
public_html/folder2/error_log
但除此之外,是否还可以将其记录到一个常规错误日志?像下面这样
public_html/general_error_log_for_all_folders
public_html/error_log
public_html/folder1/error_log
public_html/folder2/error_log
如果要为某些应用程序设置不同的错误日志,请使用运行时配置.htaccess
php_value error_log = /absolute/path/to/public_html/certain/app/error_log
您可以创建一个脚本来扫描所有目录中的错误日志。检查是否在
php中提供了绝对路径。ini
php将把所有错误记录到一个文件中。因此,yuo将获得一个包含所有错误的日志,但会丢失单独的日志。如果你想同时保持这两种状态,@Mihai的解决方案似乎是最好的。
php_value error_log = /absolute/path/to/public_html/certain/app/error_log