Skip to content

Update python-logging.md #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion doc_source/python-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,17 @@ START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST
END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125
REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms
XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true
```
```

WARNING: Settings in the logging library are global, meaning you could expose secrets in your logs. For example, the following will log the request and response in full meaning the secret string will be written to the cloudwatch log:
```
import logging

logger = logging.getLogger()
logger.setLevel(logging.DEBUG)

secretsmanager = boto3.client('secretsmanager')
secretsmanager.get_secret_value(
SecretId=secret_name
)
```