Closed nts64 closed 11 years ago
log4j appender has a little bug. when graylog host is specified with protocol (tcp: or udp:), the url is lost.
A case of wrong substring, should be substring(4), not substring(0, 4) in the two places:
if (graylogHost.startsWith("tcp:")) { String tcpGraylogHost = graylogHost.substring(0, 4); gelfSender = new GelfTCPSender(tcpGraylogHost, graylogPort); } else if (graylogHost.startsWith("udp:")) { String udpGraylogHost = graylogHost.substring(0, 4); gelfSender = new GelfUDPSender(udpGraylogHost, graylogPort); } else { gelfSender = new GelfUDPSender(graylogHost, graylogPort); }
Thanks.
log4j appender has a little bug. when graylog host is specified with protocol (tcp: or udp:), the url is lost.
A case of wrong substring, should be substring(4), not substring(0, 4) in the two places:
if (graylogHost.startsWith("tcp:")) { String tcpGraylogHost = graylogHost.substring(0, 4); gelfSender = new GelfTCPSender(tcpGraylogHost, graylogPort); } else if (graylogHost.startsWith("udp:")) { String udpGraylogHost = graylogHost.substring(0, 4); gelfSender = new GelfUDPSender(udpGraylogHost, graylogPort); } else { gelfSender = new GelfUDPSender(graylogHost, graylogPort); }