Srumith
(Srumith)
December 14, 2017, 12:09pm
1
Hi Team
Is log4j-gelf official library from graylog?
Thanks
Srumith
Srumith
(Srumith)
December 14, 2017, 12:57pm
2
Actually, we are trying logging to Graylog using log4j-gelf library. In failover mode unable to log the data to fallback appender. Same configuration works with database appender failover. Can you please provide some sample configuration.
Thanks
Srumith.
jochen
(Jochen)
December 14, 2017, 12:58pm
3
There is a Log4j 2.x GELF appender in Graylog Labs, which means it’s not necessarily supported by Graylog, Inc.
This being said, there are a lot of GELF appenders for different Java logging frameworks on the Graylog Marketplace:
Personally, I’d suggest using https://github.com/mp911de/logstash-gelf
maartenb
(Maarten)
December 19, 2017, 2:22pm
4
Hi Srumith
The log4j2 appender from https://github.com/mp911de/logstash-gelf can be wrapped in a fail-over appender.
You have to set ignoreExceptions to false to propagate the exceptions to the fail-over appender
See
* <li>version (Optional): GELF Version 1.0 or 1.1, default 1.0</li>
* <li>originHost (Optional): Originating Hostname, default FQDN Hostname</li>
* <li>extractStackTrace (Optional): Post Stack-Trace to StackTrace field (true/false/throwable reference [0 = throwable, 1 = throwable.cause, -1 = root cause]), default false</li>
* <li>filterStackTrace (Optional): Perform Stack-Trace filtering (true/false), default false</li>
* <li>mdcProfiling (Optional): Perform Profiling (Call-Duration) based on MDC Data. See <a href="#mdcProfiling">MDC
* Profiling</a>, default false</li>
* <li>facility (Optional): Name of the Facility, default gelf-java</li>
* <li>additionalFieldTypes (Optional): Type specification for additional and MDC fields. Supported types: String, long, Long,
* double, Double and discover (default if not specified, discover field type on parseability). Eg.
* field=String,field2=double</li>
* <li>ignoreExceptions (Optional): The default is <code>true</code>, causing exceptions encountered while appending events to
* be internally logged and then ignored. When set to <code>false</code> exceptions will be propagated to the caller, instead.
* You must set this to false when wrapping this Appender in a <code>FailoverAppender</code>.</li>
* </ul>
*
* <h2>Fields</h2>
*
* <p>
* Log4j v2 supports an extensive and flexible configuration in contrast to other log frameworks (JUL, log4j v1). This allows
* you to specify your needed fields you want to use in the GELF message. An empty field configuration results in a message
* containing only
I wonder which type of appender you want to fail-over to. A file appender to buffer the log events locally ?
Do you intend to send these buffered events to Graylog when it becomes available ?
In that case, I’d like to know how since I am trying to do that as well.
Maarten
system
(system)
Closed
January 2, 2018, 2:23pm
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.