Commit 29e87257 authored by Andy Wilkinson's avatar Andy Wilkinson

Provide Gradle example for using Log4j2

Closes gh-12729
parent 8a0f0354
...@@ -1648,7 +1648,7 @@ instead. If you aren't using the starters then you need to provide `jcl-over-slf ...@@ -1648,7 +1648,7 @@ instead. If you aren't using the starters then you need to provide `jcl-over-slf
(at least) in addition to Log4j 2. (at least) in addition to Log4j 2.
The simplest path is probably through the starters, even though it requires some The simplest path is probably through the starters, even though it requires some
jiggling with excludes, .e.g. in Maven: jiggling with excludes. The following example shows how to set up the starters in Maven:
[source,xml,indent=0,subs="verbatim,quotes,attributes"] [source,xml,indent=0,subs="verbatim,quotes,attributes"]
---- ----
...@@ -1672,6 +1672,23 @@ jiggling with excludes, .e.g. in Maven: ...@@ -1672,6 +1672,23 @@ jiggling with excludes, .e.g. in Maven:
</dependency> </dependency>
---- ----
And the following example shows one way to set up the starters in Gradle:
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
----
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-log4j2'
}
configurations {
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}
----
NOTE: The use of the Log4j starters gathers together the dependencies for common logging NOTE: The use of the Log4j starters gathers together the dependencies for common logging
requirements (e.g. including having Tomcat use `java.util.logging` but configuring the requirements (e.g. including having Tomcat use `java.util.logging` but configuring the
output using Log4j 2). See the Actuator Log4j 2 samples for more detail and to see it in output using Log4j 2). See the Actuator Log4j 2 samples for more detail and to see it in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment