# ServiceConnectAccessLogFormat

The format of Service Connect access logs.

- Source: [`aws-ecs/lib/base/base-service.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L244)
- Type last changed: v2.251.0 · 24 Apr 2026

## Example

```ts
declare const cluster: ecs.Cluster;
declare const taskDefinition: ecs.TaskDefinition;

const service = new ecs.FargateService(this, 'Service', {
  cluster,
  taskDefinition,
  serviceConnectConfiguration: {
    services: [
      {
        portMappingName: 'api',
      },
    ],
    accessLogConfiguration: {
      format: ecs.ServiceConnectAccessLogFormat.JSON,
      includeQueryParameters: true,
    },
    // When configuring access log,
    // you also need to configure the log driver accordingly.
    logDriver: ecs.LogDrivers.awsLogs({
      streamPrefix: 'prefix',
    }),
  },
});
```

## Members

| Member | Description |
| --- | --- |
| `TEXT` | Human-readable text format for access logs. |
| `JSON` | Structured JSON format for access logs. |

## Referenced by

- [`ServiceConnectAccessLogConfiguration`](/v2/docs/aws-cdk-lib.aws_ecs.ServiceConnectAccessLogConfiguration).format
