Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,9 @@ And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambd
```
**Note:** If you are working with Lambda on runtime post java8, please refer [issue](https://github.com/awslabs/aws-lambda-powertools-java/issues/50) for workaround

### Logging Configuration
Powertools extends the functionality of Log4J. Below is an example `log4j2.xml` file, with the `LambdaJsonLayout` configured.
## Example

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="com.amazonaws.services.lambda.runtime.log4j2">
<Appenders>
<Console name="JsonAppender" target="SYSTEM_OUT">
<LambdaJsonLayout compact="true" eventEol="true"/>
</Console>
</Appenders>
<Loggers>
<Logger name="JsonLogger" level="INFO" additivity="false">
<AppenderRef ref="JsonAppender"/>
</Logger>
<Root level="info">
<AppenderRef ref="JsonAppender"/>
</Root>
</Loggers>
</Configuration>
```
See **[example](./example/README.md)** of all features, and a SAM template with all Powertools env vars.

## Credits

Expand Down
1 change: 1 addition & 0 deletions example/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Resources:
Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object
Variables:
POWERTOOLS_SERVICE_NAME: "Payment Service"
LOG_LEVEL: INFO
Tracing: Active
Events:
HelloWorld:
Expand Down