Package com.sap.ai.sdk.core.common
Class RequestLogContext
java.lang.Object
com.sap.ai.sdk.core.common.RequestLogContext
Utility for managing MDC (Mapped Diagnostic Context) for logging of AI Core requests.
This class is intended for internal use only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRequest execution modes.static enumAI service types. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clear all MDC request context information.static voidLog the start of a request with generated request ID.static voidlogResponseSuccess(org.apache.hc.core5.http.ClassicHttpResponse response) Log successful response with duration and size information.static voidsetDestination(String destination) Set the destination for the current request context.static voidsetEndpoint(String endpoint) Set the endpoint for the current request context.static voidSet the mode for the current request context.static voidsetService(RequestLogContext.Service service) Set the service for the current request context.
-
Method Details
-
setEndpoint
Set the endpoint for the current request context.- Parameters:
endpoint- the endpoint URL
-
setDestination
Set the destination for the current request context.- Parameters:
destination- the destination name
-
setMode
Set the mode for the current request context.- Parameters:
mode- the request mode
-
setService
Set the service for the current request context.- Parameters:
service- the service type
-
clear
public static void clear()Clear all MDC request context information. -
logRequestStart
public static void logRequestStart()Log the start of a request with generated request ID. -
logResponseSuccess
public static void logResponseSuccess(@Nonnull org.apache.hc.core5.http.ClassicHttpResponse response) Log successful response with duration and size information.- Parameters:
response- the HTTP response
-