Open danieljandey opened 6 days ago
Thanks for opening your first issue here! We'll come back to you as soon as we can. In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
Hey @danieljandey thanks for opening this issue! I'll take a look this week and come back here with some update.
Logger allows you to either change the format or suppress the following keys at initialization: location, timestamp, xray_trace_id.
https://docs.powertools.aws.dev/lambda/python/latest/core/logger/#overriding-log-records
Code provided are just examples. In real-world new loggers are being defined in classes. The 'service_name' needs to stay the same for all the loggers (Through the environment variable) as the Lambda context needs to be included in all loggers (which will be defined at the entrypoint / above 'lambda_handler')
Documentation example code: https://docs.powertools.aws.dev/lambda/python/2.21.0/core/logger/#set_correlation_id-method
Expected Behaviour
Expected Output:
See 'location' key:
Current Behaviour
Actual Output:
See 'location' key:
Code snippet
Possible Solution
Unsure - need to fork and package locally, but am looking at the code:
https://github.com/aws-powertools/powertools-lambda-python/blob/develop/aws_lambda_powertools/logging/logger.py#L295C1-L297C19
Steps to Reproduce
See code snippet above
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
No response