interface JsonWithStandardFieldProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGateway.JsonWithStandardFieldProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#JsonWithStandardFieldProps |
Java | software.amazon.awscdk.services.apigateway.JsonWithStandardFieldProps |
Python | aws_cdk.aws_apigateway.JsonWithStandardFieldProps |
TypeScript (source) | aws-cdk-lib » aws_apigateway » JsonWithStandardFieldProps |
Properties for controlling items output in JSON standard format.
Example
// production stage
const prodLogGroup = new logs.LogGroup(this, "PrdLogs");
const api = new apigateway.RestApi(this, 'books', {
deployOptions: {
accessLogDestination: new apigateway.LogGroupLogDestination(prodLogGroup),
accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields(),
},
});
const deployment = new apigateway.Deployment(this, 'Deployment', {api});
// development stage
const devLogGroup = new logs.LogGroup(this, "DevLogs");
new apigateway.Stage(this, 'dev', {
deployment,
accessLogDestination: new apigateway.LogGroupLogDestination(devLogGroup),
accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields({
caller: false,
httpMethod: true,
ip: true,
protocol: true,
requestTime: true,
resourcePath: true,
responseLength: true,
status: true,
user: true,
}),
});
Properties
Name | Type | Description |
---|---|---|
caller | boolean | If this flag is enabled, the principal identifier of the caller will be output to the log. |
http | boolean | If this flag is enabled, the http method will be output to the log. |
ip | boolean | If this flag is enabled, the source IP of request will be output to the log. |
protocol | boolean | If this flag is enabled, the request protocol will be output to the log. |
request | boolean | If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log. |
resource | boolean | If this flag is enabled, the path to your resource will be output to the log. |
response | boolean | If this flag is enabled, the response payload length will be output to the log. |
status | boolean | If this flag is enabled, the method response status will be output to the log. |
user | boolean | If this flag is enabled, the principal identifier of the user will be output to the log. |
caller
Type:
boolean
If this flag is enabled, the principal identifier of the caller will be output to the log.
httpMethod
Type:
boolean
If this flag is enabled, the http method will be output to the log.
ip
Type:
boolean
If this flag is enabled, the source IP of request will be output to the log.
protocol
Type:
boolean
If this flag is enabled, the request protocol will be output to the log.
requestTime
Type:
boolean
If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log.
resourcePath
Type:
boolean
If this flag is enabled, the path to your resource will be output to the log.
responseLength
Type:
boolean
If this flag is enabled, the response payload length will be output to the log.
status
Type:
boolean
If this flag is enabled, the method response status will be output to the log.
user
Type:
boolean
If this flag is enabled, the principal identifier of the user will be output to the log.