Adding logging on error when an HTML page is returned