Class RequestLogContext

java.lang.Object
com.sap.ai.sdk.core.common.RequestLogContext

@Beta public final class RequestLogContext extends Object
Utility for managing MDC (Mapped Diagnostic Context) for logging of AI Core requests.

This class is intended for internal use only.

  • Method Details

    • setEndpoint

      public static void setEndpoint(@Nonnull String endpoint)
      Set the endpoint for the current request context.
      Parameters:
      endpoint - the endpoint URL
    • setDestination

      public static void setDestination(@Nonnull String destination)
      Set the destination for the current request context.
      Parameters:
      destination - the destination name
    • setMode

      public static void setMode(@Nonnull RequestLogContext.Mode mode)
      Set the mode for the current request context.
      Parameters:
      mode - the request mode
    • setService

      public static void setService(@Nonnull RequestLogContext.Service service)
      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