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

Support arrays #119

Closed dploeger closed 7 years ago

dploeger commented 7 years ago

It currently isn't possible to add additional fields of an array type.

For example, this:

log4j.appender.graylog2.additionalFields={'tags': ['first_tag', 'next_tag', 'some_tag']}

leads to this: Caused by: java.lang.ClassCastException: org.json.simple.JSONArray cannot be cast to java.lang.String

It would be nice, if the appender would support that.

joschi commented 7 years ago

@dploeger The GELF specification doesn't support arrays, so it wouldn't be too useful if gelfj emitted them.

dploeger commented 7 years ago

Erm, okay. I'm a bit stumped, that it works, though. 😊 Thanks.