提问人:Adam Sandor 提问时间:10/30/2023 最后编辑:Adam Sandor 更新时间:10/31/2023 访问量:53
如何防止 PHP 错误日志中的截断
How to prevent truncation in PHP error logs
问:
我有一些来自 Wordpress 的错误,最终出现在 Apache 服务器错误日志文件中。我注意到错误被截断了,这是我看不到的最重要的部分。超级奇怪的是,当我增加(目前为 8000)时,我只是在一条日志消息中多次获得相同的截断日志(见下文)。如果我进一步增加它,我会得到更多相同错误的副本。我现在迷路了哪一层(WP?PHP的?阿帕奇?正在截断,我该如何解决它。php_admin_value[log_errors_max_len]
您可以在此处看到一条日志消息:
[Sat Oct 28 14:29:10.875915 2023] [proxy_fcgi:error] [pid 20448:tid 140469874956032] [client 37.191.54.101:0] AH01071: Got error 'PHP message: modified_date was called incorrectly. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), requir
e_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action('wc_ajax_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->p
rocess_order_without_payment, WC_Order->payment_complete, do_action('woocommerce_payment_complete'), WP_Hook->do_action, WP_Hook->apply_filters, WooCommerce_Simba_PrintOrders_1_0->woocommerce_payment_complete, WooCommerce_Simba_PrintOrders_1_0->print_order_or_schedule, WooCommer
ce_Simba_PrintOrders_1_0->print_go, WooCommerce_Simba_PrintOrders_1_0->woocommerce_process_order, WooCommerce_Simba_PrintOrders_Sources_1_0->getdocument_woocommerce_pips_packing_slip, WooCommerce_Simba_PrintOrders_Sources_1_0->_pips_generate_output, WPO\\WC\\PDF_Invoices\\Docume
nts\\Order_Document->get_pdf, ...PHP message: modified_date was called incorrectly. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP
_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action('wc_ajax_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_without_payment, WC_Order->payment_complete, do_action('woocommerce_payment_complete
'), WP_Hook->do_action, WP_Hook->apply_filters, WooCommerce_Simba_PrintOrders_1_0->woocommerce_payment_complete, WooCommerce_Simba_PrintOrders_1_0->print_order_or_schedule, WooCommerce_Simba_PrintOrders_1_0->print_go, WooCommerce_Simba_PrintOrders_1_0->woocommerce_process_order,
WooCommerce_Simba_PrintOrders_Sources_1_0->getdocument_woocommerce_pips_packing_slip, WooCommerce_Simba_PrintOrders_Sources_1_0->_pips_generate_output, WPO\\WC\\PDF_Invoices\\Documents\\Order_Document->get_pdf, ...', referer: https://beadingschool.com/checkout/
请注意,截断的文本 (“Order_Document->get_pdf, ...”) 在日志消息中出现了 2 次。
答: 暂无答案
评论
error_log()
AH01071
看起来 Apache 正在记录 php-fpm。