t0xa / gelfj

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

gelfj will not forward messages if originHost is unset or empty #5

Closed joschi closed 13 years ago

joschi commented 13 years ago

Due to the changes from commit e43ac6a879ff31bb155c gelfj (or more precisely GelfSender) won't forward messages to the configured Graylog2 server if the originHost property is unset or empty.

The fallback (getting the local host's hostname) only kicks in when GelfMessage#toJson is being executed. Otherwise GelfMessage#isValid will return false due to GelfMessage.host being empty.

t0xa commented 13 years ago

That was stupid. Thanks a lot Joschi.

Added test to avoid such things in future. jar v0.6 in downloads.

joschi commented 13 years ago

Potential patch implemented in joschi/gelfj@6e3cf420b0dcadf344670de080bb0d2b33018d9b

EDIT: Seems that I've been too slow. ;)

t0xa commented 13 years ago

I like your solution better, more transparent error handling.

t0xa commented 13 years ago

Merged most of your changes but leaved both Gradle and Maven systems + Added test for host issues. v0.7 jar delivered.

Many thanks for your work.

joschi commented 13 years ago

Great, thanks for your efforts and fast response. :)