Reputation: 3080
Hi I'm trying to enable Cloudwatch logs in API Gateway using Cloudformation. However, I do not find the the documentation to do so. All I can find is Logginglevel
in the official documentation which doesn't seem to be the solution.
For context I'm looking to achieve this using Cloudformation but don't know how to. Please help.
Upvotes: 3
Views: 1827
Reputation: 540
Yaml
template snippet for ApiGateway V1:
SomeApiStage:
Type: AWS::ApiGateway::Stage
Properties:
RestApiId:
Ref: SomeApi
DeploymentId:
Ref: SomeApiDeployment
StageName: some-api
Description: Some Api stage
MethodSettings:
- ResourcePath: "/*"
HttpMethod: "*"
MetricsEnabled: true
DataTraceEnabled: true
LoggingLevel: "INFO"
Upvotes: 0
Reputation: 238189
These log settings are set using MethodSetting:
DataTraceEnabled
- is for "Log full requests..."LoggingLevel
is for "Log level"MetricsEnabled
is for "Enable detailed CloudWatch metrics"Upvotes: 2