Enum EventSourceMappingLogLevel

java.lang.Object
java.lang.Enum<EventSourceMappingLogLevel>
software.amazon.awscdk.services.lambda.EventSourceMappingLogLevel
All Implemented Interfaces:
Serializable, Comparable<EventSourceMappingLogLevel>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-03T13:58:25.667Z") @Stability(Stable) public enum EventSourceMappingLogLevel extends Enum<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 });

Example:

 import software.amazon.awscdk.services.lambda.eventsources.ManagedKafkaEventSource;
 Function myFunction;
 // Your MSK cluster arn
 String clusterArn = "arn:aws:kafka:us-east-1:0123456789019:cluster/SalesCluster/abcd1234-abcd-cafe-abab-9876543210ab-4";
 // Configure INFO level logging for production monitoring
 myFunction.addEventSource(ManagedKafkaEventSource.Builder.create()
         .clusterArn(clusterArn)
         .topic("production-events")
         .startingPosition(StartingPosition.LATEST)
         // Provisioned mode is required for observability features
         .provisionedPollerConfig(ProvisionedPollerConfig.builder()
                 .minimumPollers(1)
                 .maximumPollers(5)
                 .build())
         .logLevel(EventSourceMappingLogLevel.INFO)
         .build());
 
  • Enum Constant Details

    • INFO

      @Stability(Stable) public static final EventSourceMappingLogLevel INFO
      Messages that record the normal operation of your poller.
    • DEBUG

      @Stability(Stable) public static final EventSourceMappingLogLevel DEBUG
      Detailed information for poller debugging.
    • WARN

      @Stability(Stable) public static final EventSourceMappingLogLevel WARN
      Messages about potential errors that may lead to unexpected behavior if unaddressed.
  • Method Details

    • values

      public static EventSourceMappingLogLevel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EventSourceMappingLogLevel valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null