Skip to content

Commit 378c256

Browse files
committed
chore: adjust content to fit improved timestamp
1 parent 51c4c2d commit 378c256

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

aws_lambda_powertools/logging/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class LambdaPowertoolsFormatter(BasePowertoolsFormatter):
5353
dict it will be used directly.
5454
"""
5555

56-
default_time_format = "%Y-%m-%d %H:%M:%S.%F%z" # '2021-04-17 18:19:57.656+0200'
56+
default_time_format = "%Y-%m-%d %H:%M:%S,%F%z" # '2021-04-17 18:19:57,656+0200'
5757
custom_ms_time_directive = "%F"
5858

5959
def __init__(

docs/core/logger.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ Setting | Description | Environment variable | Constructor parameter
4444

4545
### Standard structured keys
4646

47-
Your Logger will include the following keys to your structured logging, by default:
48-
49-
Key | Type | Example | Description
50-
------------------------------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------
51-
**timestamp** | str | "2020-05-24 18:17:33,774" | Timestamp of actual log statement
52-
**level** | str | "INFO" | Logging level
53-
**location** | str | "collect.handler:1" | Source code location where statement was executed
54-
**service** | str | "payment" | Service name defined. "service_undefined" will be used if unknown
55-
**sampling_rate** | int | 0.1 | Debug logging sampling rate in percentage e.g. 10% in this case
56-
**message** | any | "Collecting payment" | Log statement value. Unserializable JSON values will be casted to string
57-
**xray_trace_id** | str | "1-5759e988-bd862e3fe1be46a994272793" | X-Ray Trace ID when Lambda function has enabled Tracing
47+
Your Logger will include the following keys to your structured logging:
48+
49+
Key | Example | Note
50+
------------------------------------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------
51+
**level**: `str` | `INFO` | Logging level
52+
**location**: `str` | `collect.handler:1` | Source code location where statement was executed
53+
**message**: `Any` | `Collecting payment` | Unserializable JSON values are casted as `str`
54+
**timestamp**: `str` | `2021-05-03 10:20:19,650+0200` | Timestamp with milliseconds, by default uses local timezone
55+
**service**: `str` | `payment` | Service name defined, by default `service_undefined`
56+
**xray_trace_id**: `str` | `1-5759e988-bd862e3fe1be46a994272793` | When [tracing is enabled](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html), it shows X-Ray Trace ID
57+
**sampling_rate**: `float` | `0.1` | When enabled, it shows sampling rate in percentage e.g. 10%
5858

5959
### Capturing Lambda context info
6060

0 commit comments

Comments
 (0)