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

Sound handling of originHost in GelfAppender #17

Closed thking closed 12 years ago

thking commented 12 years ago

I removed the getLocalHostName() method call in the constructur of GelfAppender. I did this because on my local machine this called resulted in an exception due to the local hostname could not be resolved. As such a scenario might also be happening in a production environment I propose that the originHost should be set via a static method. For this I changed the classes GelfAppender and GelfConsoleAppender.

t0xa commented 12 years ago

Hi,

Many thanks for pull request and apologies for delayed answer. Do I understand correctly: if there's no value in the config file then you will not get an originHost value?

Isn't it a bad thing when production server hostname could not be resolved?

Happy new year! :)

Anton

twinforces commented 12 years ago

It would be bad for a logger to throw an exception, because then it could hide the problem.

t0xa commented 12 years ago

Hi,

I do agree with your statement. However let me reiterate, if there's no value originHost in the config file then you will not get an originHost value in the appender?

Anton