class LogGroupLogDestination
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGateway.LogGroupLogDestination |
Java | software.amazon.awscdk.services.apigateway.LogGroupLogDestination |
Python | aws_cdk.aws_apigateway.LogGroupLogDestination |
TypeScript (source) | @aws-cdk/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()}`
)
}
});
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.