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/features/logger.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ These settings will be used across all logs emitted:
56
56
???+ info
57
57
When `POWERTOOLS_DEV` environment variable is present and set to `"true"` or `"1"`, Logger will pretty-print log messages for easier readability. We recommend to use this setting only when debugging on local environments.
58
58
59
-
See all environment variables in the [Environment variables](../index.md/#environment-variables) section.
59
+
See all environment variables in the [Environment variables](../index.md#environment-variables) section.
60
60
Check API docs to learn more about [Logger constructor options](https://docs.powertools.aws.dev/lambda/typescript/latest/api/types/_aws_lambda_powertools_logger.types.ConstructorOptions.html){target="_blank"}.
61
61
62
62
#### Example using AWS Serverless Application Model (SAM)
Injecting a custom AWS SDK v3 client allows you to [apply tracing](../core/tracer.md#patching-aws-sdk-clients) or make unit/snapshot testing easier, including SDK customizations.
416
+
Injecting a custom AWS SDK v3 client allows you to [apply tracing](../features/tracer.md#patching-aws-sdk-clients) or make unit/snapshot testing easier, including SDK customizations.
|[Tracer](./core/tracer.md)| Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions |
353
-
|[Logger](./core/logger.md)| Structured logging made easier, and a middleware to enrich structured logging with key Lambda context details |
354
-
|[Metrics](./core/metrics.md)| Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) |
352
+
|[Tracer](./features/tracer.md)| Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions |
353
+
|[Logger](./features/logger.md)| Structured logging made easier, and a middleware to enrich structured logging with key Lambda context details |
354
+
|[Metrics](./features/metrics.md)| Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) |
355
355
|[Parameters](./utilities/parameters.md)| High-level functions to retrieve one or more parameters from AWS SSM Parameter Store, AWS Secrets Manager, AWS AppConfig, and Amazon DynamoDB |
356
356
|[Idempotency](./utilities/idempotency.md)| Class method decorator, Middy middleware, and function wrapper to make your Lambda functions idempotent and prevent duplicate execution based on payload content. |
357
357
|[Batch Processing](./utilities/batch.md)| Utility to handle partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams. |
Copy file name to clipboardExpand all lines: docs/upgrade.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ V2 is focused on official support for ESM (ECMAScript modules). We've made other
22
22
|**ESM support**| Added ESM support via dual CommonJS and ESM bundling, enabling top-level `await` and tree-shaking. | - |
23
23
|**Middy.js**| Updated import path for Middy.js middlewares to leverage subpath exports - i.e. `@aws-lambda-powertools/tracer/middleware`. | Yes |
24
24
|**Types imports**| Updated import path for TypeScript types to leverage subpath exports - i.e. `@aws-lambda-powertools/logger/types`. | Yes |
25
-
|**Logger**| Changed [log sampling](./core/logger.md#sampling-debug-logs) to dynamically switch log level to `DEBUG` on a percentage of requests. | - |
25
+
|**Logger**| Changed [log sampling](./features/logger.md#sampling-debug-logs) to dynamically switch log level to `DEBUG` on a percentage of requests. | - |
26
26
|**Logger**| Updated [custom log formatter](#custom-log-formatter) to include standard as well as persistent keys. | Yes |
27
27
|**Logger**| Removed `ContextExamples` from `@aws-lambda-powertools/commons` package. | Yes |
28
28
|**Logger and Tracer**| Removed deprecated `createLogger` and `createTracer` helper functions in favor of direct instantiation. | Yes |
@@ -198,7 +198,7 @@ Below is an example of how to configure your `.eslintrc.json` file:
198
198
199
199
### Log sampling
200
200
201
-
!!! note "Disregard if you are not using the [log sampling feature](./core/logger.md#sampling-debug-logs)."
201
+
!!! note "Disregard if you are not using the [log sampling feature](./features/logger.md#sampling-debug-logs)."
202
202
203
203
In v1, log sampling implementation was inconsistent from other Powertools for AWS Lambda languages _(Python, .NET, and Java)_.
204
204
@@ -213,11 +213,11 @@ Logger `sampleRateValue` **continues** to determine the percentage of concurrent
213
213
214
214
### Custom log formatter
215
215
216
-
!!! note "Disregard if you are not customizing log output with a [custom log formatter](./core/logger.md#custom-log-formatter)."
216
+
!!! note "Disregard if you are not customizing log output with a [custom log formatter](./features/logger.md#custom-log-formatter)."
217
217
218
-
In v1, `Logger` exposed the [standard](./core/logger.md#standard-structured-keys) as a single argument, _e.g., `formatAttributes(attributes: UnformattedAttributes)`_. It expected a plain object with keys and values you wanted in the final log output.
218
+
In v1, `Logger` exposed the [standard](./features/logger.md#standard-structured-keys) as a single argument, _e.g., `formatAttributes(attributes: UnformattedAttributes)`_. It expected a plain object with keys and values you wanted in the final log output.
219
219
220
-
In v2, you have more control over **standard** (`attributes`) and [**custom keys**](./core/logger.md#appending-additional-keys) (`additionalLogAttributes`) in the `formatAttributes` method. Also, you now return a `LogItem` object to increase type safety when defining the final log output.
220
+
In v2, you have more control over **standard** (`attributes`) and [**custom keys**](./features/logger.md#appending-additional-keys) (`additionalLogAttributes`) in the `formatAttributes` method. Also, you now return a `LogItem` object to increase type safety when defining the final log output.
221
221
222
222
=== "Before"
223
223
@@ -305,7 +305,7 @@ In v2, you have more control over **standard** (`attributes`) and [**custom keys
305
305
export { MyCompanyLogFormatter };
306
306
```
307
307
308
-
1. This new argument contains all [your custom keys](./core/logger.md#appending-additional-keys).
308
+
1. This new argument contains all [your custom keys](./features/logger.md#appending-additional-keys).
309
309
2. `LogItem` is the new return object instead of a plain object.
310
310
3. If you prefer adding at the initialization, use: <br/><br/> **`LogItem({persistentAttributes: additionalLogAttributes, attributes: baseAttributes})`**
0 commit comments