Skip to content

Logger

execution.utils.logger

Secure Logger Utility

This module provides a secure logging implementation that sanitizes sensitive data and integrates with AWS Lambda Powertools for structured logging.

logger = SecureLogger() module-attribute

SecureLogger

Secure logger that sanitizes sensitive data before logging.

Extends AWS Lambda Powertools Logger with data sanitization capabilities to prevent accidental logging of sensitive information like credentials, personal data, or other confidential information.

Attributes:

Name Type Description
_max_length

Maximum length for string values before truncation

stack_level

Stack level for location tracking in logs

stack_level = 3 instance-attribute

__init__()

secure_debug(message: str, **kwargs) -> None

secure_info(message: str, **kwargs) -> None

secure_warning(message: str, **kwargs) -> None

secure_error(message: str, **kwargs) -> None

secure_exception(message: str, **kwargs) -> None

get_account_id()

Retrieve the current AWS account ID using STS.

Returns:

Type Description

String containing the AWS account ID