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
handlers=org.graylog2.logging.GelfHandler
.handlers=org.graylog2.logging.GelfHandler
.level = ALL
org.graylog2.logging.GelfHandler.level = ALL
org.graylog2.logging.GelfHandler.amqpURI=amqp://just.a.test
org.graylog2.logging.GelfHandler.amqpExchangeName=messages
org.graylog2.logging.GelfHandler.amqpRoutingKey=gelfudp
org.graylog2.logging.GelfHandler.amqpMaxRetries=5
org.graylog2.logging.GelfHandler.extractStacktrace = true
then the code will throw a NullPointerException in org.graylog2.logging.GelfHandler.publish(LogRecord) at location
if (graylogHost.startsWith("tcp:")) {
graylogHost is null in the described case.
Here's a test case to reproduce the bug, using the configuration from above as file "logging-only-amqp-test.properties":
@Test
public void testConfigureOnlyAmqpLogging() throws SecurityException, IOException {
// In versions <= 1.1.16 there's a bug that throws a NullPointerException if you
// only configure amqp but leave graylogHost empty
InputStream is = GelfHandlerTest.class.getResourceAsStream("logging-only-amqp-test.properties");
LogManager.getLogManager().readConfiguration(is);
GelfHandler gelfHandler = new GelfHandler();
gelfHandler.publish(new LogRecord(Level.INFO, "testMessage"));
}
The text was updated successfully, but these errors were encountered:
If you configure for example the following:
then the code will throw a NullPointerException in org.graylog2.logging.GelfHandler.publish(LogRecord) at location
graylogHost is null in the described case.
Here's a test case to reproduce the bug, using the configuration from above as file "logging-only-amqp-test.properties":
The text was updated successfully, but these errors were encountered: