admin管理员组文章数量:1122832
I can't find the right way to make it work. I tried many things, like putting this in wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', 'wp-content/themes/mytheme/mylog.log' ); // yeah, customized it a bit. It logs everything
ini_set('error_reporting', E_ERROR );
also tried to set it in the php.ini on various websites i manage. Not on managed hosting. Or at least not on the well known international ones. Can it be server side or syntax error, or not even possible what i want?
Thanks!
I can't find the right way to make it work. I tried many things, like putting this in wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', 'wp-content/themes/mytheme/mylog.log' ); // yeah, customized it a bit. It logs everything
ini_set('error_reporting', E_ERROR );
also tried to set it in the php.ini on various websites i manage. Not on managed hosting. Or at least not on the well known international ones. Can it be server side or syntax error, or not even possible what i want?
Thanks!
Share Improve this question edited Dec 30, 2021 at 22:55 Viktor Borítás asked Aug 26, 2020 at 17:56 Viktor BorításViktor Borítás 3042 silver badges11 bronze badges 2- maybe try including ini_set after wp_debug. Not sure whether this will work or not – Raashid Din Commented Sep 4, 2020 at 15:25
- @RaashidDin Can you show with code, exactly how you mean it, please? – Viktor Borítás Commented Sep 5, 2020 at 13:11
1 Answer
Reset to default 1In short: this is the most detailed documentation on the topic (most likely)
Oh, and here is an amazing Php Error Level calculator to set up the php error mask binary code fast (if needed)
Based on this, i made my custom error reporting:
In functions.php
function error_report_log_customize(){
error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING);
}
add_action('init','error_report_log_customize');
In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', 'wp-content/themes/my-theme/my-logfile.log');
define('WP_DEBUG_DISPLAY', false);
Only thing I'm not 100% sure about which hook is the best for this. init
seems working so far, but anyone with better insight, pls comment.
本文标签: phpHow to display only specific Error types in debuglog No noticeswarningsetc
版权声明:本文标题:php - How to display only specific Error types in debug.log? No notices, warnings, etc 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310194a1934288.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论