Logging-Handler for GELF (Graylog Extended Logging Format). This Java-Util-Logging Handler creates GELF Messages and posts
them using UDP (default) or TCP. Following parameters are supported/needed:
- graylogHost (Mandatory): Hostname/IP-Address of the Graylog Host
- tcp:(the host) for TCP, e.g. tcp:127.0.0.1 or tcp:some.host.com
- udp:(the host) for UDP, e.g. udp:127.0.0.1 or udp:some.host.com
- (the host) for UDP, e.g. 127.0.0.1 or some.host.com
- graylogPort (Optional): Port, default 12201
- originHost (Optional): Originating Hostname, default FQDN Hostname
- extractStackTrace (Optional): Post Stack-Trace to StackTrace field, default false
- filterStackTrace (Optional): Perform Stack-Trace filtering (true/false), default false
- mdcProfiling (Optional): Perform Profiling (Call-Duration) based on MDC Data. See MDC
Profiling, default false
- facility (Optional): Name of the Facility, default gelf-java
- threshold (Optional): Log-Level, default INFO
- filter (Optional): Class-Name of a Log-Filter, default none
- additionalFields(number) (Optional): Post additional fields. Eg.
.GelfLogHandler.additionalFields=fieldName=Value,field2=value2
- mdcFields (Optional): Post additional fields, pull Values from MDC. Name of the Fields are comma-separated
mdcFields=Application,Version,SomeOtherFieldName
MDC Profiling
MDC Profiling allows to calculate the runtime from request start up to the time until the log message was generated. You must
set one value in the MDC:
- profiling.requestStart.millis: Time Millis of the Request-Start (Long or String)
Two values are set by the Log Appender:
- profiling.requestEnd: End-Time of the Request-End in Date.toString-representation
- profiling.requestDuration: Duration of the request (e.g. 205ms, 16sec)