Skip to content

Commit 2f2bba4

Browse files
committed
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 spring-projectsgh-4924
1 parent b56eef2 commit 2f2bba4

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,14 +1259,25 @@ samples for more detail and to see it in action.
12591259
[[howto-configure-log4j-for-logging-yaml-or-json-config]]
12601260
==== Use YAML or JSON to configure Log4j 2
12611261
In addition to its default XML configuration format, Log4j 2 also supports YAML and JSON
1262-
configuration files. To configure Log4j 2 to use an alternative configuration file format
1263-
all you need to do is add an appropriate dependency to the classpath. To use YAML, add a
1264-
dependency on `com.fasterxml.jackson.dataformat:jackson-dataformat-yaml` and Log4j 2 will
1265-
look for configuration files names `log4j2.yaml` or `log4j2.yml`. To use JSON, add a
1266-
dependency on `com.fasterxml.jackson.core:jackson-databind` and Log4j 2 will look for
1267-
configuration files named `log4j2.json` or `log4j2.jsn`
1268-
1262+
configuration files. To configure Log4j 2 to use an alternative configuration file format,
1263+
add the appropriate dependencies to the classpath and name your
1264+
configuration files to match your chosen file format:
12691265

1266+
[cols="10,75,15"]
1267+
|===
1268+
|Format|Dependencies|File names
1269+
1270+
|YAML
1271+
a| `com.fasterxml.jackson.core:jackson-databind` +
1272+
`com.fasterxml.jackson.dataformat:jackson-dataformat-yaml`
1273+
a| `log4j2.yaml` +
1274+
`log4j2.yml`
1275+
1276+
|JSON
1277+
a| `com.fasterxml.jackson.core:jackson-databind`
1278+
a| `log4j2.json` +
1279+
`log4j2.jsn`
1280+
|===
12701281

12711282
[[howto-data-access]]
12721283
== Data Access

0 commit comments

Comments
 (0)