t0xa / gelfj

Graylog Extended Log Format (GELF) implementation in Java and log4j appender without any dependencies.
https://github.com/t0xa/gelfj/wiki
Other
185 stars 117 forks source link

Couldn't send message to graylog #99

Closed dmikheeva closed 8 years ago

dmikheeva commented 8 years ago

I tried just to send one simple message to graylog2 server. I got gelfj-1.1.14.jar,json-simple-1.1.1.jar and put them into classpath.

Then tried:

GelfMessage message = new GelfMessage("Short message", "Long message", new Date(), "1");
 message.setHost("origin-host");
 GelfUDPSender gelfSender = new GelfUDPSender(host,port);
 GelfSenderResult gelfSenderResult = gelfSender.sendMessage(message);
 if (!GelfSenderResult.OK.equals(gelfSenderResult)) {
             reportError("Error during sending GELF message. Error code: " + gelfSenderResult.getCode() + ".", gelfSenderResult.getException(), ErrorManager.WRITE_FAILURE);
 }

GelfSenderResult.OK.equals(gelfSenderResult) has true value, but i cannot see my message on graylog server. Is it enough to start before trying to use GELFAppender?

t0xa commented 8 years ago

Hi @pr1ncess,

Integration test for GelfUDPSender passes for Graylog allinone docker image.

Could you please verify:

  1. Your graylog instance has UDP Input setup. Login as Admin and go to System / Inputs -> Inputs
  2. Firewall access allows UDP communication on port 12201/udp
  3. If you use docker image for testing check that you have -p 12201:12201/udp as start parameters.

Good luck. Anton

dmikheeva commented 8 years ago

@t0xa seems that question could be addressed not for you, but thanks a lot! That's help me!

t0xa commented 8 years ago

@pr1ncess not sure what you mean. Can I close this issue?

dmikheeva commented 8 years ago

@t0xa Yes