def set_connection_logging(self, loadbalancer, val):
        """
        Sets the connection logging for the given load balancer.
        """
        uri = "/loadbalancers/%s/connectionlogging" % utils.get_id(loadbalancer)
        val = str(val).lower()
        req_body = {"connectionLogging": {
                "enabled": val,
                }}
        resp, body = self.api.method_put(uri, body=req_body)
        return body
Sets the connection logging for the given load balancer.