# EventSourceMappingLogLevel

The log level for the event source mapping poller.

Controls the verbosity of logs generated by the polling infrastructure.
Different log levels provide varying amounts of detail:

- INFO: Standard operational information suitable for production monitoring
- DEBUG: Detailed diagnostic information for development and troubleshooting
- WARN: Warning messages and potential issues that don't prevent normal operation

These logs are separate from your Lambda function's application logs and focus
on the event source mapping's internal operations such as connection management,
polling behavior, and infrastructure-level error conditions.

// Configure INFO level logging for production monitoring
let func: lambda.IFunction;
const eventSourceMapping = func.addEventSourceMapping(`eventSourceMappingName`, {
  logLevel: lambda.EventSourceMappingLogLevel.INFO
});

// Configure DEBUG level logging for detailed troubleshooting
let func: lambda.IFunction;
const eventSourceMapping = func.addEventSourceMapping(`eventSourceMappingName`, {
  logLevel: lambda.EventSourceMappingLogLevel.DEBUG
});

- Source: [`aws-lambda/lib/event-source-mapping.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-lambda/lib/event-source-mapping.ts#L377)
- Type last changed: v2.237.0 · 2 Feb 2026

## Example

```ts
import { ManagedKafkaEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';

// Your MSK cluster arn
const clusterArn = 'arn:aws:kafka:us-east-1:0123456789019:cluster/SalesCluster/abcd1234-abcd-cafe-abab-9876543210ab-4';

declare const myFunction: lambda.Function;

// Configure INFO level logging for production monitoring
myFunction.addEventSource(new ManagedKafkaEventSource({
  clusterArn,
  topic: 'production-events',
  startingPosition: lambda.StartingPosition.LATEST,
  // Provisioned mode is required for observability features
  provisionedPollerConfig: {
    minimumPollers: 1,
    maximumPollers: 5,
  },
  logLevel: lambda.EventSourceMappingLogLevel.INFO
}));
```

## Members

| Member | Description |
| --- | --- |
| `INFO` | Messages that record the normal operation of your poller. |
| `DEBUG` | Detailed information for poller debugging. |
| `WARN` | Messages about potential errors that may lead to unexpected behavior if unaddressed. |

## Referenced by

- [`EventSourceMappingOptions`](/v2/docs/aws-cdk-lib.aws_lambda.EventSourceMappingOptions).logLevel
- [`KafkaEventSourceProps`](/v2/docs/aws-cdk-lib.aws_lambda_event_sources.KafkaEventSourceProps).logLevel
