# AccessLog

Configuration for Envoy Access logs for mesh endpoints.

- Source: [`aws-appmesh/lib/shared-interfaces.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appmesh/lib/shared-interfaces.ts#L120)
- Type last changed: v2.80.0 · 20 May 2023

## Example

```ts
const vpc = new ec2.Vpc(this, 'vpc');
const namespace = new cloudmap.PrivateDnsNamespace(this, 'test-namespace', {
    vpc,
    name: 'domain.local',
});
const service = namespace.createService('Svc');

declare const mesh: appmesh.Mesh;
const node = mesh.addVirtualNode('virtual-node', {
  serviceDiscovery: appmesh.ServiceDiscovery.cloudMap(service),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 8081,
    healthCheck: appmesh.HealthCheck.http({
      healthyThreshold: 3,
      interval: Duration.seconds(5), // minimum
      path: '/health-check-path',
      timeout: Duration.seconds(2), // minimum
      unhealthyThreshold: 2,
    }),
  })],
  accessLog: appmesh.AccessLog.fromFilePath('/dev/stdout'),
});
```

## Initializer

```ts
new AccessLog()
```

## Methods

- `bind(scope: Construct): AccessLogConfig` — Called when the AccessLog type is initialized.

  Can be used to enforce
  mutual exclusivity with future properties

- `fromFilePath(filePath: string, loggingFormat?: LoggingFormat): AccessLog // chainable` (static) — Path to a file to write access logs to.
