File tree Expand file tree Collapse file tree 5 files changed +40
-1
lines changed
powertools-e2e-tests/handlers
java/software/amazon/lambda/powertools/e2e Expand file tree Collapse file tree 5 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 17
17
<groupId >software.amazon.lambda</groupId >
18
18
<artifactId >powertools-idempotency</artifactId >
19
19
</dependency >
20
+ <dependency >
21
+ <groupId >software.amazon.lambda</groupId >
22
+ <artifactId >powertools-logging</artifactId >
23
+ </dependency >
24
+ <dependency >
25
+ <groupId >org.apache.logging.log4j</groupId >
26
+ <artifactId >log4j-slf4j2-impl</artifactId >
27
+ </dependency >
20
28
<dependency >
21
29
<groupId >com.amazonaws</groupId >
22
30
<artifactId >aws-lambda-java-events</artifactId >
38
46
<groupId >software.amazon.lambda</groupId >
39
47
<artifactId >powertools-idempotency</artifactId >
40
48
</aspectLibrary >
49
+ <aspectLibrary >
50
+ <groupId >software.amazon.lambda</groupId >
51
+ <artifactId >powertools-logging</artifactId >
52
+ </aspectLibrary >
41
53
</aspectLibraries >
42
54
</configuration >
43
55
<executions >
Original file line number Diff line number Diff line change 28
28
import software .amazon .lambda .powertools .idempotency .IdempotencyConfig ;
29
29
import software .amazon .lambda .powertools .idempotency .Idempotent ;
30
30
import software .amazon .lambda .powertools .idempotency .persistence .DynamoDBPersistenceStore ;
31
+ import software .amazon .lambda .powertools .logging .Logging ;
31
32
32
33
33
34
public class Function implements RequestHandler <Input , String > {
@@ -53,6 +54,7 @@ public Function(DynamoDbClient client) {
53
54
).configure ();
54
55
}
55
56
57
+ @ Logging (logEvent = true )
56
58
@ Idempotent
57
59
public String handleRequest (Input input , Context context ) {
58
60
DateTimeFormatter dtf = DateTimeFormatter .ISO_DATE_TIME .withZone (TimeZone .getTimeZone ("UTC" ).toZoneId ());
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <Configuration >
3
+ <Appenders >
4
+ <Console name =" JsonAppender" target =" SYSTEM_OUT" >
5
+ <JsonTemplateLayout eventTemplateUri =" classpath:LambdaJsonLayout.json" />
6
+ </Console >
7
+ </Appenders >
8
+ <Loggers >
9
+ <Root level =" INFO" >
10
+ <AppenderRef ref =" JsonAppender" />
11
+ </Root >
12
+ <Logger name =" JsonLogger" level =" INFO" additivity =" false" >
13
+ <AppenderRef ref =" JsonAppender" />
14
+ </Logger >
15
+ </Loggers >
16
+ </Configuration >
Original file line number Diff line number Diff line change 29
29
<groupId >com.amazonaws</groupId >
30
30
<artifactId >aws-lambda-java-events</artifactId >
31
31
</dependency >
32
-
32
+ <dependency >
33
+ <groupId >org.apache.logging.log4j</groupId >
34
+ <artifactId >log4j-slf4j2-impl</artifactId >
35
+ </dependency >
33
36
</dependencies >
34
37
35
38
<build >
Original file line number Diff line number Diff line change 21
21
<aspectj .plugin.version>1.13.1</aspectj .plugin.version>
22
22
<maven .compiler.version>3.11.0</maven .compiler.version>
23
23
<aws .sdk.version>2.20.108</aws .sdk.version>
24
+ <log4j .version>2.20.0</log4j .version>
24
25
</properties >
25
26
26
27
<modules >
81
82
<artifactId >aws-lambda-java-events</artifactId >
82
83
<version >${lambda.java.events} </version >
83
84
</dependency >
85
+ <dependency >
86
+ <groupId >org.apache.logging.log4j</groupId >
87
+ <artifactId >log4j-slf4j2-impl</artifactId >
88
+ <version >${log4j.version} </version >
89
+ </dependency >
84
90
</dependencies >
85
91
</dependencyManagement >
86
92
You can’t perform that action at this time.
0 commit comments