Closed emsearcy closed 7 years ago
I can confirm that applying this patch and installing Yajl fixes the mismatching Encoding issues
So, please merge this patch and release a new gem version for everyone to easily fix!
Thanks
When will this be released? Need it for fluentd
@milgner @tessie ⬆️
Any update on getting this released now that it is merged? Thanks.
Replace #to_json with a faster Yajl implementation, when Yajl is present.
Also, this fixes the JSON::GeneratorError error: "source sequence is illegal/malformed utf-8", which happens when source hashes do not have correct encoding. In particular, this affects emsearcy/fluent-plugin-gelf, which may have strings coming in with improper encoding, becuase fluentd treats all logs as ASCII-8BIT (see fluent/fluentd#215).
There are other opportunities for performance improvements with Yajl, like using its stream processing to write to the sockets as it syncronously encodes and/or compresses, but I've ignored those for now as they would require architectural changes to gelf-rb.