Trying to use ConnectorRequestInterceptor to log request and response whenever a http-connector service task is executing

Hi,

Application: Spring boot , ConnectorRequestInterceptor , camunda

I am trying to log request and response of api that are being hit by connector(service task) .
For intercept the requests to log the payload and other details have tried using org.camunda.connect.spi.ConnectorRequestInterceptor but I am not able to register the ConnectorRequestInterceptor in the project as a result not able to log the request payload also I am not able to understand how to catch the response and log it.
Any sort of help would be deeply appreciated. Thanks in advance.
Please find my code below:

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.camunda.connect.impl.ConnectCoreLogger;
import org.camunda.connect.impl.ConnectLogger;
import org.camunda.connect.spi.ConnectorInvocation;
import org.camunda.connect.spi.ConnectorRequestInterceptor;
import org.springframework.stereotype.Component;

@Component
public class RequestLogging implements ConnectorRequestInterceptor {
private static final Log log = LogFactory.getLog(RequestLogging.class);

protected static ConnectCoreLogger LOG = ConnectLogger.CORE_LOGGER;

public static String HTTP_CONNECTOR_ID = "http-connector";
public static String SOAP_HTTP_CONNECTOR_ID = "soap-http-connector";

// @Override
// public void process(Request request, Response response) throws IOException {
// try {
// log.info(“Received request: " + request.getMethod() + " " + request.getRequestURI()+” "+request.getInputStream());
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// }

@Override
public Object handleInvocation(ConnectorInvocation invocation) throws Exception {

   Object r1= invocation.getTarget();
   log.info("request target*******"+r1.toString());
   log.info("request details******"+invocation.getRequest());
   System.out.println(r1.toString());

    return invocation.proceed();

    //return true;
}

}

Main class:
import org.camunda.connect.Connectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Application {

@Autowired
private RequestLogging requestLogging;
// private RequestLogging loggingConnectorRequest;

@Autowired
public void setRequestLogging(RequestLogging requestLogging) {
this.requestLogging = requestLogging;
}
static Logger log = LoggerFactory.getLogger(Application.class);
public static void main(String… args) {

SpringApplication.run(Application.class, args);
log.info("main method");

}
@Bean
public Connectors registerConnectorInterceptor() {
Connectors INSTANCE = Connectors.getInstance();
INSTANCE.getConnectorById(Connectors.HTTP_CONNECTOR_ID).addRequestInterceptor(requestLogging);
System.out.println(“connector called”);
return INSTANCE;
}
}