From 2f2bba4d268b22e375091a380b1fda5dbbab8691 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 15 Jan 2016 12:51:19 +0000 Subject: [PATCH] Fix docs for using YAML to configure Log4J 2 Previously, the documentation stated that jackson-dataformat-yaml was the only required dependency. This is incorrect. jackson-databind is also required. Closes gh-4924 --- spring-boot-docs/src/main/asciidoc/howto.adoc | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 6d8617570b..c2cf6f0096 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1259,14 +1259,25 @@ samples for more detail and to see it in action. [[howto-configure-log4j-for-logging-yaml-or-json-config]] ==== Use YAML or JSON to configure Log4j 2 In addition to its default XML configuration format, Log4j 2 also supports YAML and JSON -configuration files. To configure Log4j 2 to use an alternative configuration file format -all you need to do is add an appropriate dependency to the classpath. To use YAML, add a -dependency on `com.fasterxml.jackson.dataformat:jackson-dataformat-yaml` and Log4j 2 will -look for configuration files names `log4j2.yaml` or `log4j2.yml`. To use JSON, add a -dependency on `com.fasterxml.jackson.core:jackson-databind` and Log4j 2 will look for -configuration files named `log4j2.json` or `log4j2.jsn` +configuration files. To configure Log4j 2 to use an alternative configuration file format, +add the appropriate dependencies to the classpath and name your +configuration files to match your chosen file format: +[cols="10,75,15"] +|=== +|Format|Dependencies|File names +|YAML +a| `com.fasterxml.jackson.core:jackson-databind` + + `com.fasterxml.jackson.dataformat:jackson-dataformat-yaml` +a| `log4j2.yaml` + + `log4j2.yml` + +|JSON +a| `com.fasterxml.jackson.core:jackson-databind` +a| `log4j2.json` + + `log4j2.jsn` +|=== [[howto-data-access]] == Data Access