io.convergence_platform.services.observability.RequestLogFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of service-lib Show documentation
Show all versions of service-lib Show documentation
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);
}
}