All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.convergence_platform.services.observability.RequestLogFactory Maven / Gradle / Ivy

Go to download

Holds the common functionality needed by all Convergence Platform-based services written in Java.

The newest version!
package io.convergence_platform.services.observability;

import io.convergence_platform.common.responses.HttpErrors;
import io.convergence_platform.services.constants.IServiceInfo;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class RequestLogFactory {
    @Value("${security.is_behind_gateway}")
    private boolean isBehindGateway;

    @Value("${observability.request_id_prefix}")
    private String requestIdPrefix;

    @Autowired
    private IServiceInfo serviceInfo;

    public RequestLog create(HttpServletRequest request, Object... parameters) {
        return RequestLog.initialize(requestIdPrefix, request, serviceInfo, isBehindGateway, parameters);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy