def log(self, request):
        """
        Write a line representing C{request} to the access log file.

        @param request: The request object about which to log.
        @type request: L{Request}
        """
        try:
            logFile = self.logFile
        except AttributeError:
            pass
        else:
            line = self._logFormatter(self._logDateTime, request) + u"\n"
            logFile.write(line.encode('utf8'))

        Write a line representing C{request} to the access log file.

        @param request: The request object about which to log.
        @type request: L{Request}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/http.py