Class LogGroupLogDestination

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.apigateway.LogGroupLogDestination
All Implemented Interfaces:
IAccessLogDestination, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-02-23T02:06:27.532Z") @Stability(Stable) public class LogGroupLogDestination extends software.amazon.jsii.JsiiObject implements IAccessLogDestination
Use CloudWatch Logs as a custom access log destination for API Gateway.

Example:

 LogGroup logGroup = new LogGroup(this, "ApiGatewayAccessLogs");
 RestApi.Builder.create(this, "books")
         .deployOptions(StageOptions.builder()
                 .accessLogDestination(new LogGroupLogDestination(logGroup))
                 .accessLogFormat(AccessLogFormat.custom(String.format("%s %s %s%n      %s %s", AccessLogField.contextRequestId(), AccessLogField.contextErrorMessage(), AccessLogField.contextErrorMessageString(), AccessLogField.contextAuthorizerError(), AccessLogField.contextAuthorizerIntegrationStatus())))
                 .build())
         .build();
 
  • Constructor Details

    • LogGroupLogDestination

      protected LogGroupLogDestination(software.amazon.jsii.JsiiObjectRef objRef)
    • LogGroupLogDestination

      protected LogGroupLogDestination(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • LogGroupLogDestination

      @Stability(Stable) public LogGroupLogDestination(@NotNull ILogGroup logGroup)
      Parameters:
      logGroup - This parameter is required.
  • Method Details