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: CHANGELOG.md
+31
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,37 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) fo
8
8
9
9
## [Unreleased]
10
10
11
+
## [1.18.0] - 2023-11-16
12
+
13
+
### Added
14
+
15
+
* feat: add support for [Lambda Advanced Logging Controls (ALC)](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html#monitoring-cloudwatchlogs-advanced) (#1514) by @jeromevdl
16
+
* feat: Add support for POWERTOOLS_LOGGER_LOG_EVENT (#1510) by @AlexeySoshin
17
+
18
+
### Maintenance
19
+
20
+
* fix: json schema 403 error (#1457) by @jeromevdl
21
+
* fix: array jmespath fail in idempotency module (#1420) by @jeromevdl
22
+
* chore: java21 support in our build (#1488) by @jeromevdl
23
+
* chore: Addition of Warn Message If Invalid Annotation Key While Tracing #1511 (#1512) by @jdoherty
24
+
* fix: null namespace should fallback to default namespace (#1506) by @jeromevdl
25
+
* fix: get trace id from system property when env var is not set (#1503) by @mriccia
26
+
* chore: artifacts size on good branches (#1493) by @jeromevdl
27
+
* fix: enforce jackson databind version (#1472) by @jeromevdl
28
+
* chore: add missing projects and improve workflow (#1487) by @jeromevdl
29
+
* chore: Reporting size of the jars in GitHub comments (#1196) by @jeromevdl
30
+
* Deps: Bump third party dependencies to the latest versions.
31
+
32
+
### Documentation
33
+
34
+
* docs(customer-reference): add Vertex Pharmaceuticals as a customer reference (#1486) by @scottgerring
35
+
* docs: Adding Kotlin example. (#1454) by @jasoniharris
36
+
* docs: Terraform example (#1478) by @skal111
37
+
* docs: Add Serveless Framework example (#1363) by @AlexeySoshin
38
+
* docs: Fix link to SQS large message migration guide (#1422) by @scottgerring
39
+
* docs(logging): correct log example keys (#1411) by @walmsles
40
+
* docs: Update gradle configuration readme (#1359) by @scottgerring
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-2
Original file line number
Diff line number
Diff line change
@@ -55,8 +55,7 @@ We strongly recommend installing the CheckStyle-IDEA plugin and apply the provid
55
55
2. After installing the plugin, open the preferences (`⌘,` on macOS, or `Ctrl+Alt+S` on Windows/Linux) and search for _Code Style_. Click on the gear icon near the scheme and import checkstyle configuration. Click on "Apply" and "OK".
56
56

57
57
58
-
3. Select the code you've created (module, package, class) and reformat code: `⌘⌥L` (macOS), or `Ctrl+Alt+L` (Windows/Linux):
59
-

58
+
3. Select the code you've created (module, package, class) and reformat code: `⌘⌥L` (macOS), or `Ctrl+Alt+L` (Windows/Linux).
60
59
61
60
4. Apply the reformat, optimize imports, rearrange and cleanup to your code and only to java files:
AspectJ does not yet support Java 21 [[1]](https://github.com/eclipse-aspectj/aspectj/issues/260), [[2]](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/dist/doc/JavaVersionCompatibility.md).
19
+
If you need to use aspects - either Powertools features leveraging aspects or other libraries - you should use the JDK 17 compiler and target either the Java 17 or Java 21
20
+
Lambda runtimes.
21
+
14
22
### Installation
15
23
16
24
Powertools for AWS Lambda (Java) is available in Maven Central. You can use your favourite dependency management tool to install it
@@ -22,17 +30,17 @@ Powertools for AWS Lambda (Java) is available in Maven Central. You can use your
22
30
<dependency>
23
31
<groupId>software.amazon.lambda</groupId>
24
32
<artifactId>powertools-tracing</artifactId>
25
-
<version>1.17.0</version>
33
+
<version>1.18.0</version>
26
34
</dependency>
27
35
<dependency>
28
36
<groupId>software.amazon.lambda</groupId>
29
37
<artifactId>powertools-logging</artifactId>
30
-
<version>1.17.0</version>
38
+
<version>1.18.0</version>
31
39
</dependency>
32
40
<dependency>
33
41
<groupId>software.amazon.lambda</groupId>
34
42
<artifactId>powertools-metrics</artifactId>
35
-
<version>1.17.0</version>
43
+
<version>1.18.0</version>
36
44
</dependency>
37
45
...
38
46
</dependencies>
@@ -192,7 +200,7 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam
192
200
193
201
## Examples
194
202
195
-
See the latest release of the **[examples](https://github.com/aws-powertools/powertools-lambda-java/tree/v1.17.0/examples)** for example projects showcasing usage of different utilities.
203
+
See the latest release of the **[examples](https://github.com/aws-powertools/powertools-lambda-java/tree/v1.18.0/examples)** for example projects showcasing usage of different utilities.
196
204
197
205
Have a demo project to contribute which showcase usage of different utilities from powertools? We are happy to accept it [here](CONTRIBUTING.md#security-issue-notifications).
Copy file name to clipboardExpand all lines: docs/core/logging.md
+44-4
Original file line number
Diff line number
Diff line change
@@ -217,9 +217,7 @@ Key | Type | Example | Description
217
217
218
218
## Capturing context Lambda info
219
219
220
-
You can enrich your structured logs with key Lambda context information via `logEvent` annotation parameter.
221
-
You can also explicitly log any incoming event using `logEvent` param. Refer [Override default object mapper](#override-default-object-mapper)
222
-
to customise what is logged.
220
+
When debugging in non-production environments, you can instruct Logger to log the incoming event with `@Logger(logEvent = true)` or via `POWERTOOLS_LOGGER_LOG_EVENT=true` environment variable.
223
221
224
222
!!! warning
225
223
Log event is disabled by default to prevent sensitive info being logged.
@@ -265,7 +263,7 @@ to customise what is logged.
265
263
}
266
264
```
267
265
268
-
### Customising fields in logs
266
+
### Customising fields in logs
269
267
270
268
- Utility by default emits `timestamp` field in the logs in format `yyyy-MM-dd'T'HH:mm:ss.SSSZz` and in system default timezone.
271
269
If you need to customize format and timezone, you can do so by configuring `log4j2.component.properties` and configuring properties as shown in example below:
@@ -598,6 +596,48 @@ via `samplingRate` attribute on annotation.
598
596
POWERTOOLS_LOGGER_SAMPLE_RATE: 0.5
599
597
```
600
598
599
+
## AWS Lambda Advanced Logging Controls
600
+
With AWS [Lambda Advanced Logging Controls (ALC)](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html#monitoring-cloudwatchlogs-advanced), you can control the output format of your logs as either `TEXT` or `JSON` and specify the minimum accepted log level for your application.
601
+
Regardless of the output format setting in Lambda, Powertools for AWS Lambda will always output JSON formatted logging messages.
602
+
603
+
When you have this feature enabled, log messages that don’t meet the configured log level are discarded by Lambda.
604
+
For example, if you set the minimum log level to `WARN`, you will only receive `WARN` and `ERROR` messages in your AWS CloudWatch Logs, all other log levels will be discarded by Lambda.
605
+
606
+
```mermaid
607
+
sequenceDiagram
608
+
participant Lambda service
609
+
participant Lambda function
610
+
participant Application Logger
611
+
612
+
Note over Lambda service: AWS_LAMBDA_LOG_LEVEL="WARN"
Logger will automatically listen for the `AWS_LAMBDA_LOG_FORMAT` and `AWS_LAMBDA_LOG_LEVEL` environment variables, and change behaviour if they’re found to ensure as much compatibility as possible.
625
+
626
+
### Priority of log level settings in Powertools for AWS Lambda
627
+
628
+
When the Advanced Logging Controls feature is enabled, we are unable to increase the minimum log level below the `AWS_LAMBDA_LOG_LEVEL` environment variable value, see [AWS Lambda service documentation](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs.html#monitoring-cloudwatchlogs-log-level) for more details.
629
+
630
+
We prioritise log level settings in this order:
631
+
632
+
1.`AWS_LAMBDA_LOG_LEVEL` environment variable
633
+
2.`POWERTOOLS_LOG_LEVEL` environment variable
634
+
635
+
In the event you have set `POWERTOOLS_LOG_LEVEL` to a level lower than the ACL setting, Powertools for AWS Lambda will output a warning log message informing you that your messages will be discarded by Lambda.
636
+
637
+
### Timestamp format
638
+
639
+
When the Advanced Logging Controls feature is enabled, Powertools for AWS Lambda must comply with the timestamp format required by AWS Lambda, which is [RFC3339](https://www.rfc-editor.org/rfc/rfc3339).
640
+
In this case the format will be `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.
601
641
602
642
## Upgrade to JsonTemplateLayout from deprecated LambdaJsonLayout configuration in log4j2.xml
Copy file name to clipboardExpand all lines: docs/index.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,18 @@ Powertools for AWS Lambda (Java) is a suite of utilities for AWS Lambda Function
11
11
Powertools for AWS Lambda is also available for [Python](https://docs.powertools.aws.dev/lambda/python/latest/){target="_blank"}, [TypeScript](https://docs.powertools.aws.dev/lambda/typescript/latest/){target="_blank"}, and [.NET](https://docs.powertools.aws.dev/lambda/dotnet/){target="_blank"}
12
12
13
13
14
-
!!! tip "Looking for a quick run through of the core utilities?"
14
+
???+ tip "Looking for a quick run through of the core utilities?"
15
15
Check out [this detailed blog post](https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-aws-lambda-powertools-java/) with a practical example. To dive deeper,
16
16
the [Powertools for AWS Lambda (Java) workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/a7011c82-e4af-4a52-80fa-fcd61f1dacd9/en-US/introduction) is a great next step.
17
17
18
+
???+ tip "Java Compatability"
19
+
Powertools for AWS Lambda (Java) supports all Java version from 8 up to 21 as well as the
AspectJ does not yet support Java 21 [[1]](https://github.com/eclipse-aspectj/aspectj/issues/260), [[2]](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/dist/doc/JavaVersionCompatibility.md).
23
+
If you need to use aspects - either Powertools features leveraging aspects or other libraries - you should use the JDK 17 compiler and target either the Java 17 or Java 21
24
+
Lambda runtimes.
25
+
18
26
## Tenets
19
27
20
28
This project separates core utilities that will be available in other runtimes vs general utilities that might not be available across all runtimes.
@@ -285,5 +293,7 @@ Depending on your version of Java (either Java 1.8 or 11+), the configuration sl
285
293
|**POWERTOOLS_METRICS_NAMESPACE**| Sets namespace used for metrics |[Metrics](./core/metrics)|
Copy file name to clipboardExpand all lines: powertools-common/src/main/java/software/amazon/lambda/powertools/common/internal/LambdaHandlerProcessor.java
0 commit comments