File tree Expand file tree Collapse file tree 6 files changed +21
-29
lines changed Expand file tree Collapse file tree 6 files changed +21
-29
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ repositories {
7
7
}
8
8
9
9
dependencies {
10
- implementation platform(' software.amazon.awssdk:bom:2.10.73 ' )
10
+ implementation platform(' software.amazon.awssdk:bom:2.10.72 ' )
11
11
implementation platform(' com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0' )
12
12
implementation ' software.amazon.awssdk:lambda'
13
13
implementation ' com.amazonaws:aws-xray-recorder-sdk-core'
14
14
implementation ' com.amazonaws:aws-lambda-java-core:1.2.1'
15
15
implementation ' com.amazonaws:aws-lambda-java-events:2.2.9'
16
- runtimeOnly ' org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,) '
16
+ implementation ' org.slf4j:slf4j-nop:2.0.6 '
17
17
testImplementation ' com.amazonaws:aws-lambda-java-tests:1.1.1'
18
18
testImplementation ' org.junit.jupiter:junit-jupiter-api:5.8.2'
19
19
testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.8.2'
Original file line number Diff line number Diff line change 23
23
<version >2.2.9</version >
24
24
</dependency >
25
25
<dependency >
26
- <groupId >org.apache.logging.log4j </groupId >
27
- <artifactId >log4j-slf4j18-impl </artifactId >
28
- <version >[2.17.1,) </version >
29
- </dependency >
26
+ <groupId >org.slf4j </groupId >
27
+ <artifactId >slf4j-nop </artifactId >
28
+ <version >2.0.6 </version >
29
+ </dependency >
30
30
<dependency >
31
31
<groupId >software.amazon.awssdk</groupId >
32
32
<artifactId >lambda</artifactId >
Original file line number Diff line number Diff line change 1
1
package example ;
2
2
3
3
import com .amazonaws .services .lambda .runtime .Context ;
4
+ import com .amazonaws .services .lambda .runtime .LambdaLogger ;
4
5
import com .amazonaws .services .lambda .runtime .RequestHandler ;
5
6
6
7
import java .util .Map ;
7
8
8
- import org .slf4j .Logger ;
9
- import org .slf4j .LoggerFactory ;
10
-
11
9
import software .amazon .awssdk .services .lambda .LambdaClient ;
12
10
import software .amazon .awssdk .services .lambda .model .GetAccountSettingsResponse ;
13
11
import software .amazon .awssdk .services .lambda .model .LambdaException ;
14
12
15
13
// Handler value: example.Handler
16
14
public class Handler implements RequestHandler <Map <String ,String >, String > {
17
15
18
- private static final Logger logger = LoggerFactory .getLogger (Handler .class );
19
16
private static final LambdaClient lambdaClient = LambdaClient .builder ().build ();
20
17
21
18
@ Override
22
19
public String handleRequest (Map <String ,String > event , Context context ) {
23
20
24
- logger .info ("ENVIRONMENT VARIABLES: " + System .getenv ());
25
- logger .info ("EVENT: " + event );
21
+ LambdaLogger logger = context .getLogger ();
22
+ logger .log ("ENVIRONMENT VARIABLES: " + System .getenv ());
23
+ logger .log ("EVENT: " + event );
26
24
27
25
GetAccountSettingsResponse response = null ;
28
26
try {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,3 +18,13 @@ Resources:
18
18
- AWSXrayWriteOnlyAccess
19
19
- AWSLambdaVPCAccessExecutionRole
20
20
Tracing : Active
21
+ Layers :
22
+ - !Ref libs
23
+ libs :
24
+ Type : AWS::Serverless::LayerVersion
25
+ Properties :
26
+ LayerName : blank-java-lib
27
+ Description : Dependencies for the blank-java sample app.
28
+ ContentUri : build/blank-java-lib.zip
29
+ CompatibleRuntimes :
30
+ - java11
Original file line number Diff line number Diff line change @@ -27,4 +27,4 @@ Resources:
27
27
Description : Dependencies for the blank-java sample app.
28
28
ContentUri : build/blank-java-lib.zip
29
29
CompatibleRuntimes :
30
- - java8
30
+ - java11
You can’t perform that action at this time.
0 commit comments