'Log an http based api call.
Args:
request: A WSGI request object.
response: A WSGI response object.'

def LogHttpAdminUIAccess(self, request, response):

    event_id = self.GetNewEventId()
    api_method = response.headers.get('X-API-Method', 'unknown')
    api_reason = response.headers.get('X-GRR-Reason', 'none')
    log_msg = ('%s    API    call    [%s]    by    %s    (reason:    %s):    %s    [%d]' % (event_id, api_method, request.user, api_reason, request.full_path, response.status_code))
    logging.info(log_msg)
