@@ -0,0 +1,1207 @@
+package com.padma.aem.core.sling.listener;%0A%0Aimport org.apache.felix.scr.annotations.Component;%0Aimport org.apache.sling.api.request.SlingRequestEvent;%0Aimport org.apache.sling.api.request.SlingRequestListener;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport javax.servlet.ServletRequest;%0A%0A%0A/**%0A * It will listen on all requests are handle by SlingMainServlet (i.e including CRXDE etc.)%0A * %3Cp%3E%0A * Created on 8/10/16.%0A */%0A@Component%0A// @Service // disable it currently.%0Apublic class RequestTrackingListener implements SlingRequestListener%0A%7B%0A%09private final Logger logger = LoggerFactory.getLogger(RequestTrackingListener.class);%0A%0A%09@Override%0A%09public void onEvent(final SlingRequestEvent slingRequestEvent)%0A%09%7B%0A%09%09final ServletRequest request = slingRequestEvent.getServletRequest();%0A%09%09final SlingRequestEvent.EventType type = slingRequestEvent.getType();%0A%09%09switch (type)%0A%09%09%7B%0A%09%09%09case EVENT_INIT: // before request is handled by SlingMainServlet%0A%09%09%09%09logger.info(%22Started process request %22 + request.toString());%0A%09%09%09%09break;%0A%09%09%09case EVENT_DESTROY: // after service() method of SlingMainServlet.%0A%09%09%09%09logger.info(%22Ended process request %22 + request.toString());%0A%09%09%09%09break;%0A%09%09%09default:%0A%09%09%09%09break;%0A%09%09%7D%0A%09%7D%0A%7D%0A

add sling listener