# ServiceConnectAccessLogConfiguration

Configuration for Service Connect access logs.

Service Connect access logs provide detailed telemetry about individual requests processed by the Service Connect proxy,
including HTTP methods, paths, response codes, and timing information.

- Source: [`aws-ecs/lib/base/base-service.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L265)
- 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',
    }),
  },
});
```

## Properties

- `format`: [ServiceConnectAccessLogFormat](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ServiceConnectAccessLogFormat.html) (required) — The format for Service Connect access log output.

  - TEXT: Human-readable text format
  - JSON: Structured JSON format for log analysis tools

- `includeQueryParameters`: boolean — Whether to include query parameters in Service Connect access logs.

  **Default:** undefined - AWS ECS default is false, which means that query parameters are not included in access logs

  When enabled, query parameters from HTTP requests are included in the access logs.
  Consider security and privacy implications as query parameters may contain sensitive information such as request IDs and tokens.
