Home › Forums › WordPress › Config Setup › Write to debug.log file.
Tagged: debug, wordpress
With define(‘WP_DEBUG_LOG’, true); set in wp-config.php you can write to the debug log from your script with:
write_log( string );
if (!function_exists('write_log')) { function write_log ( $log ) { if ( true === WP_DEBUG ) { if ( is_array( $log ) || is_object( $log ) ) { error_log( print_r( $log, true ) ); } else { error_log( $log ); } } } }
You must be logged in to reply to this topic.