# Logging

A class used to configure Logging during AwsCustomResource SDK calls.

- Source: [`custom-resources/lib/aws-custom-resource/logging.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/logging.ts#L20)
- Type last changed: v2.138.0 · 18 Apr 2024

## Example

```ts
const getParameter = new cr.AwsCustomResource(this, 'GetParameter', {
  onUpdate: {
    service: 'SSM',
    action: 'GetParameter',
    parameters: {
      Name: 'my-parameter',
      WithDecryption: true,
    },
    physicalResourceId: cr.PhysicalResourceId.of(Date.now().toString()),
    logging: cr.Logging.withDataHidden(),
  },
  policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
    resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE,
  }),
});
```

## Methods

- `all(): Logging // chainable` (static) — Enables logging of all logged data in the lambda handler.

  This includes the event object, the API call response, all fields in the response object
  returned by the lambda, and any errors encountered.

- `withDataHidden(): Logging // chainable` (static) — Hides logging of data associated with the API call response.

  This includes hiding the raw API
  call response and the `Data` field associated with the lambda handler response.
