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.84.0 (build 5404dcf)", date="2023-06-19T16:30:45.002Z") @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", AccessLogField.contextRequestId(), AccessLogField.contextErrorMessage(), AccessLogField.contextErrorMessageString())))
                 .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