22
33![ aws provider] ( https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900 )
44
5-
65A suite of utilities for AWS Lambda Functions that makes tracing with AWS X-Ray, structured logging and creating custom metrics asynchronously easier.
76
87** [ 📜Documentation] ( https://awslabs.github.io/aws-lambda-powertools-java/ ) ** | ** [ Feature request] ( https://github.com/awslabs/aws-lambda-powertools-java/issues/new?assignees=&labels=feature-request%2C+triage&template=feature_request.md&title= ) ** | ** [ 🐛Bug Report] ( https://github.com/awslabs/aws-lambda-powertools-java/issues/new?assignees=&labels=bug%2C+triage&template=bug_report.md&title= ) ** | ** [ Detailed blog post] ( https://aws.amazon.com/blogs/opensource/simplifying-serverless-best-practices-with-lambda-powertools/ ) **
@@ -27,6 +26,9 @@ Powertools is available in Maven Central. You can use your favourite dependency
2726And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project:
2827
2928``` xml
29+ <build >
30+ <plugins >
31+ ...
3032 <plugin >
3133 <groupId >com.nickwongdev</groupId >
3234 <artifactId >aspectj-maven-plugin</artifactId >
@@ -50,25 +52,37 @@ And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambd
5052 </execution >
5153 </executions >
5254 </plugin >
53-
54- ```
55- * [ gradle ] ( https://gradle.org/ ) :
55+ ...
56+ </ plugins >
57+ </ build >
5658```
57- repositories {
58- mavenCentral()
59- }
6059
61- dependencies {
62- powertools 'software.amazon.lambda:aws-lambda-powertools-java:YOUR_REQUIRED_VERSION'
63- }
60+ ### Logging Configuration
61+ Powertools extends the functionality of Log4J. Below is an example ` log4j2.xml ` file, with the ` LambdaJsonLayout ` configured.
62+
63+ ``` xml
64+ <?xml version =" 1.0" encoding =" UTF-8" ?>
65+ <Configuration packages =" com.amazonaws.services.lambda.runtime.log4j2" >
66+ <Appenders >
67+ <Console name =" JsonAppender" target =" SYSTEM_OUT" >
68+ <LambdaJsonLayout compact =" true" eventEol =" true" />
69+ </Console >
70+ </Appenders >
71+ <Loggers >
72+ <Logger name =" JsonLogger" level =" INFO" additivity =" false" >
73+ <AppenderRef ref =" JsonAppender" />
74+ </Logger >
75+ <Root level =" info" >
76+ <AppenderRef ref =" JsonAppender" />
77+ </Root >
78+ </Loggers >
79+ </Configuration >
6480```
6581
6682## Credits
6783
68- * Structured logging initial implementation from [ aws-lambda-logging] ( https://gitlab.com/hadrien/aws_lambda_logging )
69- * Powertools idea [ DAZN Powertools] ( https://github.com/getndazn/dazn-lambda-powertools/ )
7084* [ Gatsby Apollo Theme for Docs] ( https://github.com/apollographql/gatsby-theme-apollo/tree/master/packages/gatsby-theme-apollo-docs )
7185
7286## License
7387
74- This library is licensed under the MIT-0 License. See the LICENSE file.
88+ This library is licensed under the Apache License, Version 2.0 . See the LICENSE file.
0 commit comments