You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/logger.md
+47-3
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ Logger provides an opinionated logger with output structured as JSON.
14
14
15
15
## Key features
16
16
17
-
* Capture key fields from Lambda context, cold start and structures logging output as JSON
18
-
* Log Lambda context when instructed (disabled by default)
19
-
* Log sampling prints all logs for a percentage of invocations (disabled by default)
17
+
* Capture key fields from Lambda context, cold start and structure logging output as JSON
18
+
* Log Lambda event when instructed (disabled by default)
19
+
* Log sampling prints all the logs for a percentage of invocations (disabled by default)
20
20
* Append additional keys to structured log at any point in time
21
21
22
22
## Getting started
@@ -193,6 +193,50 @@ In each case, the printed log will look like this:
193
193
}
194
194
```
195
195
196
+
#### Log incoming event
197
+
198
+
When debugging in non-production environments, you can instruct Logger to log the incoming event with the middleware/decorator parameter `logEvent` or via POWERTOOLS_LOGGER_LOG_EVENT env var set to `true`.
199
+
200
+
???+ warning
201
+
This is disabled by default to prevent sensitive info being logged
202
+
203
+
=== "Middy Middleware"
204
+
205
+
```typescript hl_lines="11"
206
+
import { Logger, injectLambdaContext } from '@aws-lambda-powertools/logger';
|**POWERTOOLS_LOG_DEDUPLICATION_DISABLED**| Disables log deduplication filter protection to use Pytest Live Log feature |[Logger](./core/logger)|`false`|
0 commit comments