Package com.sap.ai.sdk.core.common

# Class RequestLogContext

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

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.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `RequestLogContext.Mode`
  Request execution modes.
  `static enum`
  `RequestLogContext.Service`
  AI service types.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `clear()`
  Clear all MDC request context information.
  `static void`
  `logRequestStart()`
  Log the start of a request with generated request ID.
  `static void`
  `logResponseSuccess(org.apache.hc.core5.http.ClassicHttpResponse response)`
  Log successful response with duration and size information.
  `static void`
  `setDestination(String destination)`
  Set the destination for the current request context.
  `static void`
  `setEndpoint(String endpoint)`
  Set the endpoint for the current request context.
  `static void`
  `setMode(RequestLogContext.Mode mode)`
  Set the mode for the current request context.
  `static void`
  `setService(RequestLogContext.Service service)`
  Set the service for the current request context.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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