write developer debug statements to separate log

You can tell error_log() where to put its output: error_log( ‘my debugging output’, 3, ‘/my/debug/log/location/log.txt’ ); It might be more convenient to add your own function: if ( ! function_exists( ‘my_debug’ ) ) { function my_debug( $x = ” ) { // Uses print_r() in case $x isn’t a string. error_log( print_r( $x, 1 ), … Read more

How to hook into debug.log?

WordPress tells PHP, using ini_set(), in wp_debug_mode() which errors should be handled and which file they should be written to. The function is called in wp-settings.php when WP is starting up. As suggested by David in How to catch all PHP errors with custom error handler? answers you could use PHP’s set_error_handler() to define a … Read more

Fatal error on random blog posts

Pretty simple. comments.php is trying to call a function twentyseventeen_get_svg() which doesn’t exist: Uncaught Error: Call to undefined function You’ll probably need to contact the theme developer or, just find the part of the code in comments.php (line 88) that calls the function and comment it out. Looks like that function comes with the theme … Read more