You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [Providers common to LoggingEvents and AccessEvents](#providers-common-to-loggingevents-and-accessevents)
@@ -1817,6 +1818,37 @@ For example:
1817
1818
can even be used within a `PatternLayout` to format stacktraces in any non-JSON logs you may have.
1818
1819
1819
1820
1821
+
## Registering Additional Providers
1822
+
1823
+
`LogstashEncoder`, `LogstashAccessEncoder` and their "layout" counterparts all come with a predefined set of encoders. You can register additional JsonProviders using the `<provider>` configuration property as shown in the following example:
You can add several additional JsonProviders using multiple `<provider>` entries. They will appear just after the default providers registered by the LogstashEncoder.
1844
+
1845
+
In this example, the pattern provider produces a "message" JSON field that will conflict with the message field produced by the MessageJsonProvider already registered by the LogstashEncoder itself. Different options to avoid the conflict:
1846
+
1847
+
- you instruct LogstashEncoder to use a different field name using the [fieldNames](#customizing-standard-field-names) configuration property;
1848
+
- you disable the message provider that comes with the encoder (that's the option illustrated in the example above);
1849
+
- you use a different field name in your pattern.
1850
+
1851
+
1820
1852
## Prefix/Suffix/Separator
1821
1853
1822
1854
You can specify a prefix (written before the JSON object),
0 commit comments