diff --git a/functions/notify_slack.py b/functions/notify_slack.py index d7e7c864..020ff7b9 100644 --- a/functions/notify_slack.py +++ b/functions/notify_slack.py @@ -453,6 +453,9 @@ def lambda_handler(event: Dict[str, Any], context: Dict[str, Any]) -> str: :param context: lambda expected context object :returns: none """ + log_level = os.environ.get("LOG_LEVEL", "WARN").upper() + logging.basicConfig(level=getattr(logging, log_level, logging.WARN)) + if os.environ.get("LOG_EVENTS", "False") == "True": logging.info(f"Event logging enabled: `{json.dumps(event)}`") diff --git a/variables.tf b/variables.tf index 75813fc0..36ee77d0 100644 --- a/variables.tf +++ b/variables.tf @@ -168,6 +168,12 @@ variable "log_events" { default = false } +variable "log_level" { + description = "The log level for the Lambda function" + type = string + default = "WARN" +} + variable "reserved_concurrent_executions" { description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations" type = number