Skip to content
v2.274.0

ServiceConnectAccessLogFormat Enum ​

The format of Service Connect access logs.

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 ​

MemberDescription
TEXTHuman-readable text format for access logs.
JSONStructured JSON format for access logs.

Referenced by ​