xxxxxxxxxx
//You can enable WordPress logging adding this to wp-config.php file
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
xxxxxxxxxx
// inside wp-config.php
@ini_set( 'log_errors', 'On' );
@ini_set( 'display_errors', 'On' );
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'SCRIPT_DEBUG', true );
define('SAVEQUERIES', true);
This function can be called to display complex data inside /wp-content/debug.log
xxxxxxxxxx
// Easy error log for WordPress
function wpError($var){
error_log(print_r($var, true));
}
// Example of use:
wpError(get_current_user_id());