def test_logFailed(self):
        """
        When a request fails, the string form of the failure is logged.
        """
        logObserver = proto_helpers.EventLoggingObserver.createWithCleanup(
            self,
            globalLogPublisher
        )

        f = failure.Failure(ArbitraryError())
        request = DummyRequest([b''])
        issue = distrib.Issue(request)
        issue.failed(f)
        self.assertEquals(1, len(logObserver))
        self.assertIn(
            "Failure instance",
            logObserver[0]["log_format"]
        )

        When a request fails, the string form of the failure is logged.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_distrib.py