def _log_request(self, env, response, request_type):
        """
        Logs requests as they were made to SOS.  Will include original
        hostname and path.  Will include the status of the response but
        will not include the bytes transferred.  For that you must look at
        the swift proxy logs which you can reference with the transaction id.
        """
        if not self.log_access_requests:
            return
        trans_time = '%.4f' % (time() -
                               env.get('sos.start_time', time()))
        the_request = quote(unquote(env['PATH_INFO']))
        if env.get('QUERY_STRING'):
            the_request = the_request + '?' + env['QUERY_STRING']
        # remote user for zeus
        client = env.get('HTTP_X_CLUSTER_CLIENT_IP')
        if not client and 'HTTP_X_FORWARDED_FOR' in env:
            # remote user for other lbs
            client = env['HTTP_X_FORWARDED_FOR'].split(',')[0].strip()
        extra_data = '-'
        if hasattr(response, 'extra_log_data'):
            extra_data = response.extra_log_data
        self.logger.info(' '.join(quote(str(x)) for x in (
            client or '-',
            env.get('REMOTE_ADDR', '-'),
            strftime('%d/%b/%Y/%H/%M/%S', gmtime()),
            request_type,
            env['REQUEST_METHOD'],
            env.get('HTTP_HOST', '-'),
            the_request,
            env['SERVER_PROTOCOL'],
            response.status_int,
            env.get('HTTP_REFERER', '-'),
            env.get('HTTP_USER_AGENT', '-'),
            env.get('HTTP_X_AUTH_TOKEN', '-'),
            env.get('HTTP_ETAG', '-'),
            env.get('swift.trans_id', '-'),
            trans_time,
            extra_data)))
dataset/ETHPy150Open dpgoetz/sos/sos/origin.py/OriginServer._log_request/original