Index: src/wp-includes/load.php
===================================================================
--- src/wp-includes/load.php	(revision 42984)
+++ src/wp-includes/load.php	(working copy)
@@ -307,12 +307,13 @@
  * from changing the global configuration setting. Defining `WP_DEBUG_DISPLAY`
  * as false will force errors to be hidden.
  *
- * When `WP_DEBUG_LOG` is true, errors will be logged to debug.log in the content
- * directory.
+ * When `WP_DEBUG_LOG` is true, errors will be logged to `wp-content/debug.log`.
+ * When `WP_DEBUG_LOG` is a valid path, errors will be logged to the specified file.
  *
  * Errors are never displayed for XML-RPC, REST, and Ajax requests.
  *
  * @since 3.0.0
+ * @since 5.0.0 `WP_DEBUG_LOG` can be a file path.
  * @access private
  */
 function wp_debug_mode() {
@@ -341,9 +342,17 @@
 			ini_set( 'display_errors', 0 );
 		}
 
-		if ( WP_DEBUG_LOG ) {
+		if ( in_array( strtolower( (string) WP_DEBUG_LOG ), array( 'true', '1' ), true ) ) {
+			$log_path = WP_CONTENT_DIR . '/debug.log';
+		} elseif ( is_string( WP_DEBUG_LOG ) ) {
+			$log_path = WP_DEBUG_LOG;
+		} else {
+			$log_path = false;
+		}
+
+		if ( $log_path ) {
 			ini_set( 'log_errors', 1 );
-			ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
+			ini_set( 'error_log', $log_path );
 		}
 	} else {
 		error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
