Commit 53b29bd
feat(logging): Log buffering support for Logj42 and Logback (#2103)
* Log buffer PoC with log4j2 appender implementation.
* Add buffer cleaning to avoid memory leak and flushBufferOnUncaughtError option to Logging aspect.
* Call appenders with logevent directly from BufferingAppender.
* Extract buffer management logic into KeyBuffer class and keep log4j appender minimal.
* Unit tests for BufferingAppender
* Rename to Log4jConstants.
* Make Appender detection independent of plugin name.
* Add assertions in unit test to test multiple appenders.
* Make assertion stronger to assert that each message appears twice because we configured two appenders as proxies.
* Add logback implementation. Decouple KeyBuffer and BufferingAppender to avoid circular dependency when flushing buffer on error.
* Log error in AppStream example.
* Update Logging E2E test to use log buffering.
* Prepare Logging E2E test to support paramaterized versions by logging backend.
* Add Logging E2E tests for both logback and log4j2.
* Debug not found appender on Linux.
* Isolate log4j context loading in unit tests.
* Avoid logging config leakage in log4j unit test.
* Avoid config leaking in logback unit tests.
* Update Graal metadata for powertools-logging.
* Update Graal metadata for powertools-logging-log4j.
* Update Graal metadata for powertools-logging-logback.
* Address Sonar findings.
* Address pmd findings.
* Set allowCommentedBlocks=true in pmd rules.
* Fix thread-safety issue in double-checked singleton instance creation.
* Increase scope of thread-safety tests in KeyBuffer.
* Try to satisfy pmd executor service closing.
* Try to satisfy pmd executor service closing.
* Add PMD suppressions with reason where appropriate.
* Add PMD suppressions with reason where appropriate.
* Restore original example.
* Enable log sampling again.
* Restore formatting in pmd ruleset.
* Update Javadoc of BufferingAppenders.
* Remove unncessary cleanup.
* Remove duplicated infrastructure clearnup in LoggingE2E.
* Make javadoc for Keybuffer more concise.
* Add comment for large event rejection.
* Fix grammer in error message.
* Remove redundant tests in PowertoolsLoggingTest.
* Add developer documentation.
* Fix sonar finding.
* Clarify log buffering log level configuration with upper and lower bound example.
* Update docs/core/logging.md
Co-authored-by: Stefano Vozza <svozza@gmail.com>
* Update docs/core/logging.md
Co-authored-by: Stefano Vozza <svozza@gmail.com>
---------
Co-authored-by: Stefano Vozza <svozza@gmail.com>1 parent be3f37f commit 53b29bd
File tree
76 files changed
+3052
-1043
lines changed- .github
- docs/core
- examples/powertools-examples-core-utilities/sam
- src/main
- java/helloworld
- resources
- powertools-e2e-tests
- handlers
- logging-log4j
- src/main
- java/software/amazon/lambda/powertools/e2e
- resources
- META-INF/native-image
- com.amazonaws
- aws-lambda-java-core
- aws-lambda-java-events
- aws-lambda-java-runtime-interface-client
- aws-lambda-java-serialization
- software.amazon.lambda.powertools.e2e
- logging-logback
- src/main
- java/software/amazon/lambda/powertools/e2e
- resources
- META-INF/native-image
- com.amazonaws
- aws-lambda-java-core
- aws-lambda-java-events
- aws-lambda-java-runtime-interface-client
- aws-lambda-java-serialization
- software.amazon.lambda.powertools.e2e
- metrics/src/main/java/software/amazon/lambda/powertools/e2e
- tracing/src/main/java/software/amazon/lambda/powertools/e2e
- src/test/java/software/amazon/lambda/powertools
- powertools-logging
- powertools-logging-log4j/src
- main
- java/software/amazon/lambda/powertools/logging/log4j
- internal
- resources/META-INF
- native-image/software.amazon.lambda/powertools-logging-log4j
- services
- test
- java/software/amazon/lambda/powertools/logging
- internal
- handler
- log4j
- internal
- resources
- powertools-logging-logback
- src
- main
- java/software/amazon/lambda/powertools/logging/logback
- internal
- resources/META-INF/native-image/software.amazon.lambda/powertools-logging-logback
- test
- java/software/amazon/lambda/powertools/logging
- logback
- resources
- src
- main
- java/software/amazon/lambda/powertools/logging
- internal
- resources/META-INF/native-image/software.amazon.lambda/powertools-logging
- test/java/software/amazon/lambda/powertools/logging
- handlers
- internal
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
76 files changed
+3052
-1043
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
641 | 644 | | |
642 | 645 | | |
643 | 646 | | |
644 | | - | |
| 647 | + | |
Large diffs are not rendered by default.
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 100 | | |
106 | 101 | | |
107 | 102 | | |
| |||
Lines changed: 22 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
| 21 | + | |
23 | 22 | | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | | - | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 20 | | |
26 | 21 | | |
27 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | | - | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| |||
0 commit comments