function debug($message){
error_log($message, 3, get_template_directory() . '/debug.log');
}
I added the above function to each of the templates.
For example, front-page.php includes a line that goes like this: debug("front-page.php \n");
I use tail -f debug.log
in the terminal to determine which templates are being used by a particular page.
Here is the result.
src="/"
in your 404 template