If Debug logging is enabled, simply use the error_log() function and it will be written to /wp-content/debug.log . Refer this article to see how it can be done:
You can also write the error_log to a file. WP_DEBUG need not be set to true.
error_log("\n[Timestamp - " . time() . "] " . print_r($settings,true), 3, ABSPATH . "/my_error_log.log");
Using var_dump() instead of error_log(): Writing to the PHP error_log with var_dump & print_r