SystemLogLevel

class aws_cdk.aws_lambda.SystemLogLevel(value)

Bases: Enum

Lambda service will automatically captures system logs about function invocation generated by the Lambda service (known as system logs) and sends these logs to a default CloudWatch log group named after the Lambda function.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_logs import ILogGroup

# log_group: ILogGroup


lambda_.Function(self, "Lambda",
    code=lambda_.InlineCode("foo"),
    handler="index.handler",
    runtime=lambda_.Runtime.NODEJS_18_X,
    logging_format=lambda_.LoggingFormat.JSON,
    system_log_level=lambda_.SystemLogLevel.INFO,
    application_log_level=lambda_.ApplicationLogLevel.INFO,
    log_group=log_group
)

Attributes

DEBUG

Lambda will capture only logs at debug level.

INFO

Lambda will capture only logs at info level.

WARN

Lambda will capture only logs at warn level.