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

1. Log helpful error message on JSON parse failure, 2. Object value instead of String #104

Open the-james-burton opened 8 years ago

the-james-burton commented 8 years ago

Hi Anton,

Here is the PR as promised. It is only a small change. It helps when developing clients as you can see more easily when you are going wrong.

This change also has a Map<String, Object> to hold the key value pairs instead of Map<String, String>. That lets me send a numeric type to Graylog and have it end up in Elasticsearch as as numeric type.

I saw that you already had a test for bad JSON, so I left that as it was. I'm actually not sure how to validate the presence of the new error message in the logs, but you can see it does get printed to the console when building.

Regards, James