Closed
Description
Thanks for the useful tools.
I use aws-lambda-powertools-python in Lambda python 3.8.
for document
Logger allows you to either change the format or suppress the following keys altogether at the initialization: location, timestamp, level, xray_trace_id, and datefmt
but I can't suppress the 'sampling_rate' and 'xray_trace_id'
(Is it a specification that 'sampling_rate' cannot be suppressed?)
I want to suppress the 'sampling_rate' and 'xray_trace_id'.
Expected Behavior
logger = Logger(
service="payment",
level="INFO",
sampling_rate=None,
xray_trace_id=None,
timestamp=None,
location=None,
)
Expected output is below.
{"level": "INFO", "message": {"test": 123}, "service": "payment"}
Current Behavior
I write below code.
logger = Logger(
service="payment",
level="INFO",
sampling_rate=None,
xray_trace_id=None,
timestamp=None,
location=None,
)
The actual output is below.
(xray_trace_id is masked)
{"level": "INFO", "message": {"test": 123}, "service": "payment", "sampling_rate": 0.0, "xray_trace_id": "1-xxxxxxx"}
Steps to Reproduce (for bugs)
- I write code for Lambda function.
- I invoke Lambda function.
- Display the output.(but not the output I expected)
Environment
- Powertools version used: 1.8.0
- Packaging format (Layers, PyPi): Layers
- AWS Lambda function runtime: Python 3.8
- Debugging logs
Metadata
Metadata
Assignees
Type
Projects
Status
Triage