Skip to content

Commit c6eb7fe

Browse files
committed
docs(logger): update sections for pretty printing logs using POWERTOOLS_DEV env var
1 parent c724fe3 commit c6eb7fe

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Diff for: docs/core/logger.md

+3
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ Your Logger will include the following keys to your structured logging (default
104104
| **xray_trace_id**: `string` | `1-5759e988-bd862e3fe1be46a994272793` | X-Ray Trace ID. This value is always presented in Lambda environment, whether [tracing is enabled](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html){target="_blank"} or not. Logger will always log this value. |
105105
| **error**: `Object` | `{ name: "Error", location: "/my-project/handler.ts:18", message: "Unexpected error #1", stack: "[stacktrace]"}` | Optional - An object containing information about the Error passed to the logger |
106106

107+
???+ info
108+
When `POWERTOOLS_DEV` environment variable is present and set to `"true"`, Logger will pretty-print log messages for easier readability. It is for debugging purposes and is not supposed to use in production environment.
109+
107110
### Capturing Lambda context info
108111

109112
You can enrich your structured logs with key Lambda context information in multiple ways.

Diff for: docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ Core utilities such as Tracing, Logging, and Metrics will be available across al
293293
| **POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS** | Captures HTTP(s) requests as segments. | [Tracer](./core/tracer) | `true` |
294294
| **POWERTOOLS_LOGGER_LOG_EVENT** | Logs incoming event | [Logger](./core/logger) | `false` |
295295
| **POWERTOOLS_LOGGER_SAMPLE_RATE** | Debug log sampling | [Logger](./core/logger) | `0` |
296+
| **POWERTOOLS_DEV** | Increase JSON indentation to ease debugging when running functions locally or in a non-production environment | [Logger](./core/logger) | `0` |
296297
| **LOG_LEVEL** | Sets logging level | [Logger](./core/logger) | `INFO` |
297298

298299
## Tenets

0 commit comments

Comments
 (0)