File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,32 @@ If using maven shade plugin, set the plugin configuration as follows
6262</plugins >
6363```
6464
65+ If you are using the [ John Rengelman] ( https://github.com/johnrengelman/shadow ) Gradle shadow plugin, then the plugin configuration is as follows:
66+
67+ ``` groovy
68+
69+ dependencies{
70+ ...
71+ implementation group: 'com.amazonaws', name: 'aws-lambda-java-log4j2', version: '1.1.0'
72+ implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4jVersion
73+ implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4jVersion
74+ }
75+
76+ jar {
77+ enabled = false
78+ }
79+ shadowJar {
80+ transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer)
81+ }
82+
83+ build.dependsOn(shadowJar)
84+
85+ ```
86+
87+ If you are using the ` sam build ` and ` sam deploy ` commands to deploy your lambda function, then you don't
88+ need to use the shadow jar plugin. The ` sam ` cli-tool merges itself the ` Log4j2Plugins.dat `
89+ files.
90+
6591### 2. Configure log4j2 using log4j2.xml file
6692
6793Add the following file ` <project-dir>/src/main/resources/log4j2.xml `
You can’t perform that action at this time.
0 commit comments