A handy function to write log to uploads/debug.log
define('WP_DEBUG', true); // To enable debugging. Leave things just like this to output errors, warnings, notices to the screen:
define( 'WP_DEBUG_LOG', true ); // To turn on logging
define( 'WP_DEBUG_DISPLAY', false ); // To prevent output of errors, warnings, notices to the screen (which I personally find SUPER annoying):
Once done you can now Call
write_log('Debug anything');
And you will see logs in your wp-content/debug.log file.