// Path: spat-services/src/main/java/com/pcalouche/spat/interceptors/LoggerInterceptor.java
// @Component
// public class LoggerInterceptor extends HandlerInterceptorAdapter {
//     private static final Logger logger = LoggerFactory.getLogger(LoggerInterceptor.class);
// 
//     @Override
//     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
//         long startTime = System.currentTimeMillis();
//         request.setAttribute("startTime", startTime);
//         logger.debug(String.format("Starting request for time for %s", request.getRequestURL()));
//         return true;
//     }
// 
//     @Override
//     public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
//         long startTime = (Long) request.getAttribute("startTime");
//         long endTime = System.currentTimeMillis();
//         long executeTime = endTime - startTime;
//         logger.debug((String.format("Execute time for %s was %d ms", request.getRequestURL(), executeTime)));
//     }
// }


import com.pcalouche.spat.interceptors.LoggerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
package com.pcalouche.spat.config;


@Configuration
public class WebConfig implements WebMvcConfigurer {
    private final SpatProperties spatProperties;
// Path: spat-services/src/main/java/com/pcalouche/spat/interceptors/LoggerInterceptor.java
// @Component
// public class LoggerInterceptor extends HandlerInterceptorAdapter {
//     private static final Logger logger = LoggerFactory.getLogger(LoggerInterceptor.class);
// 
//     @Override
//     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
//         long startTime = System.currentTimeMillis();
//         request.setAttribute("startTime", startTime);
//         logger.debug(String.format("Starting request for time for %s", request.getRequestURL()));
//         return true;
//     }
// 
//     @Override
//     public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
//         long startTime = (Long) request.getAttribute("startTime");
//         long endTime = System.currentTimeMillis();
//         long executeTime = endTime - startTime;
//         logger.debug((String.format("Execute time for %s was %d ms", request.getRequestURL(), executeTime)));
//     }
// }


// Path: spat-services/src/main/java/com/pcalouche/spat/config/WebConfig.java
import com.pcalouche.spat.interceptors.LoggerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

package com.pcalouche.spat.config;


@Configuration
public class WebConfig implements WebMvcConfigurer {
    private final SpatProperties spatProperties;
    private final LoggerInterceptor loggerInterceptor;