# JsonWithStandardFieldProps

Properties for controlling items output in JSON standard format.

- Source: [`aws-apigateway/lib/access-log.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigateway/lib/access-log.ts#L686)

## Example

```ts
// 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

- `caller`: boolean (required) — If this flag is enabled, the principal identifier of the caller will be output to the log.

- `httpMethod`: boolean (required) — If this flag is enabled, the http method will be output to the log.

- `ip`: boolean (required) — If this flag is enabled, the source IP of request will be output to the log.

- `protocol`: boolean (required) — If this flag is enabled, the request protocol will be output to the log.

- `requestTime`: boolean (required) — If this flag is enabled, the CLF-formatted request time((dd/MMM/yyyy:HH:mm:ss +-hhmm) will be output to the log.

- `resourcePath`: boolean (required) — If this flag is enabled, the path to your resource will be output to the log.

- `responseLength`: boolean (required) — If this flag is enabled, the response payload length will be output to the log.

- `status`: boolean (required) — If this flag is enabled, the method response status will be output to the log.

- `user`: boolean (required) — If this flag is enabled, the principal identifier of the user will be output to the log.
