class LogGroupLogDestination
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGateway.LogGroupLogDestination |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#LogGroupLogDestination |
![]() | software.amazon.awscdk.services.apigateway.LogGroupLogDestination |
![]() | aws_cdk.aws_apigateway.LogGroupLogDestination |
![]() | aws-cdk-lib » aws_apigateway » LogGroupLogDestination |
Implements
IAccess
Use CloudWatch Logs as a custom access log destination for API Gateway.
Example
const logGroup = new logs.LogGroup(this, "ApiGatewayAccessLogs");
new apigateway.RestApi(this, 'books', {
deployOptions: {
accessLogDestination: new apigateway.LogGroupLogDestination(logGroup),
accessLogFormat: apigateway.AccessLogFormat.custom(
`${apigateway.AccessLogField.contextRequestId()} ${apigateway.AccessLogField.contextErrorMessage()} ${apigateway.AccessLogField.contextErrorMessageString()}
${apigateway.AccessLogField.contextAuthorizerError()} ${apigateway.AccessLogField.contextAuthorizerIntegrationStatus()}`
)
}
});
Initializer
new LogGroupLogDestination(logGroup: ILogGroup)
Parameters
- logGroup
ILog
Group
Methods
Name | Description |
---|---|
bind(_stage) | Binds this destination to the CloudWatch Logs. |
bind(_stage)
public bind(_stage: IStage): AccessLogDestinationConfig
Parameters
- _stage
IStage
Returns
Binds this destination to the CloudWatch Logs.