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
To enable structured logging, set the property configprop:logging.structured.format.console[] (for console output) or configprop:logging.structured.format.file[] (for file output) to the id of the format you want to use.
@@ -490,6 +491,53 @@ logging:
490
491
491
492
NOTE: configprop:logging.structured.ecs.service.name[] will default to configprop:spring.application.name[] if not specified.
492
493
494
+
NOTE: configprop:logging.structured.ecs.service.version[] will default to configprop:spring.application.version[] if not specified.
495
+
496
+
497
+
498
+
[[features.logging.structured.gelf]]
499
+
=== Graylog Extended Log Format (GELF)
500
+
https://go2docs.graylog.org/current/getting_in_log_data/gelf.html[Graylog Extended Log Format] is a JSON based logging format for the Graylog log analytics platform.
501
+
502
+
To enable the Graylog Extended Log Format, set the appropriate `format` property to `gelf`:
This format also adds every key value pair contained in the MDC to the JSON object.
521
+
You can also use the https://www.slf4j.org/manual.html#fluent[SLF4J fluent logging API] to add key value pairs to the logged JSON object with the https://www.slf4j.org/apidocs/org/slf4j/spi/LoggingEventBuilder.html#addKeyValue(java.lang.String,java.lang.Object)[addKeyValue] method.
522
+
523
+
The `service` values can be customized using `logging.structured.gelf.service` properties:
524
+
525
+
[configprops,yaml]
526
+
----
527
+
logging:
528
+
structured:
529
+
gelf:
530
+
service:
531
+
name: MyService
532
+
version: 1.0
533
+
environment: Production
534
+
node-name: Primary
535
+
----
536
+
537
+
NOTE: configprop:logging.structured.gelf.service.name[] will default to configprop:spring.application.name[] if not specified.
538
+
539
+
NOTE: configprop:logging.structured.gelf.service.version[] will default to configprop:spring.application.version[] if not specified.
0 commit comments