Open ghost opened 6 years ago
I am experiencing the same problem, did you have any luck resolving this issue?
Hello, I just to have the same problem, try writing tcp: before the host, like log4j.appender.graylog2.graylogHost=tcp:127.0.0.1
The code verify that substring:
try { if (graylogHost != null && graylogHost.startsWith("tcp:")) { String tcpGraylogHost = graylogHost.substring(4); gelfSender = getGelfTCPSender(tcpGraylogHost, graylogPort); } else if (graylogHost != null && graylogHost.startsWith("udp:")) { String udpGraylogHost = graylogHost.substring(4); gelfSender = getGelfUDPSender(udpGraylogHost, graylogPort); } else if (amqpURI != null) { gelfSender = getGelfAMQPSender(amqpURI, amqpExchangeName, amqpRoutingKey, amqpMaxRetries); } else { gelfSender = getGelfUDPSender(graylogHost, graylogPort); } }
Yeah, the reason is that you have to set prefix for graylogHost: tcp or udp. So it'd be for example tcp:127.0.0.1
Hello. Need some help, please. I try make a blank project with only log4j usage with graylog2 appender. But in graylog2 i don't see messages and wireshark don't see a requests on TCP 12201.
pom.xml:
log4j.properties:
Main.java:
Where is i`m wrong?
Appender is loading in build process because if i specify wrong graylogHost i see error. But there is no error message if i specify wrong port. And (how i wrote upper) Wireshark not see a connect to localhost 12201. If i use netcat for send GELF message to 12201 - wireshark see it.