@@ -39,7 +39,7 @@ You can also explicitly set a service name via `service` param or via `POWERTOOL
39
39
``` python:title=app.py
40
40
from aws_lambda_powertools.logging import Logger
41
41
# POWERTOOLS_SERVICE_NAME defined
42
- logger = Logger() # highlight-line
42
+ logger = Logger() # highlight-line
43
43
44
44
# Explicit definition
45
45
Logger(service = " payment" , level = " INFO" )
@@ -58,7 +58,7 @@ Key | Type | Example | Description
58
58
** sampling_rate** | int | 0.1 | Debug logging sampling rate in percentage e.g. 1% in this case
59
59
** message** | any | "Collecting payment" | Log statement value. Unserializable JSON values will be casted to string
60
60
61
- ## Capturing context Lambda info
61
+ ## Capturing context Lambda info
62
62
63
63
You can enrich your structured logs with key Lambda context information via ` inject_lambda_context ` .
64
64
@@ -109,7 +109,7 @@ Key | Type | Example
109
109
<summary ><strong >Exerpt output in CloudWatch Logs</strong ></summary >
110
110
111
111
``` json:title=cloudwatch_logs.json
112
- {
112
+ {
113
113
"timestamp" :" 2020-05-24 18:17:33,774" ,
114
114
"level" :" INFO" ,
115
115
"location" :" collect.handler:1" ,
@@ -125,7 +125,7 @@ Key | Type | Example
125
125
"message" : " Collecting payment"
126
126
}
127
127
128
- {
128
+ {
129
129
"timestamp" :" 2020-05-24 18:17:33,774" ,
130
130
"level" :" INFO" ,
131
131
"location" :" collect.handler:15" ,
@@ -137,7 +137,7 @@ Key | Type | Example
137
137
"cold_start" : true ,
138
138
"sampling_rate" : 0.0 ,
139
139
// highlight-start
140
- "message" :{
140
+ "message" :{
141
141
"operation" :" collect_payment" ,
142
142
"charge_id" : " ch_AZFlk2345C0"
143
143
}
@@ -148,7 +148,7 @@ Key | Type | Example
148
148
149
149
## Appending additional keys
150
150
151
- You can append your own keys to your existing Logger via ` structure_logs ` with ** append** param.
151
+ You can append your own keys to your existing Logger via ` structure_logs ` with ** append** param.
152
152
153
153
``` python:title=collect.py
154
154
from aws_lambda_powertools.logging import Logger
@@ -166,7 +166,7 @@ def handler(event, context)
166
166
<summary ><strong >Exerpt output in CloudWatch Logs</strong ></summary >
167
167
168
168
``` json:title=cloudwatch_logs.jsonn
169
- {
169
+ {
170
170
"timestamp": "2020-05-24 18:17:33,774",
171
171
"level": "INFO",
172
172
"location": "collect.handler:1",
@@ -209,7 +209,7 @@ def handler(event, context)
209
209
<summary ><strong >Exerpt output in CloudWatch Logs</strong ></summary >
210
210
211
211
``` json:title=cloudwatch_logs.json
212
- {
212
+ {
213
213
"timestamp" : " 2020-05-24 18:17:33,774" ,
214
214
"level" : " INFO" ,
215
215
"location" : " collect.handler:1" ,
@@ -223,4 +223,4 @@ def handler(event, context)
223
223
"message" : " Collecting payment"
224
224
}
225
225
```
226
- </details >
226
+ </details >
0 commit comments