In my humble opinion, there is an inconsistent within the treatment of the field type conversion.
The doc says:
"You can configure a specific field to be converted to a numeric type. Key is the additional field key (and should thus begin with an underscore), value is the type to convert to. Currently supported types are int, long, float and double."
But this is only true when you set the flag "includeFullMDC" to true.
If you don't set the explicit flag, and you create explicit mapping for additional fields, then the field type conversion is in the form:
requestId:_request_idrequestId:long
I think that this could be easily changed with a minimun change in the file GelfConverter.java to unified criteria:
Proposed change (line 202)
Replace:
map.put(additionalFields.get(key), convertFieldType(field, key));
With:
map.put(additionalFields.get(key), convertFieldType(field, additionalFields.get(key)));
Another aproach could be:
Replace (line 193 and line 195)
map.put(additionalFields.get(e.getKey()), convertFieldType(e.getValue(), additionalFields.get(e.getKey())));
map.put("" + e.getKey(), convertFieldType(e.getValue(), "" + e.getKey()));
With
map.put(additionalFields.get(e.getKey()), convertFieldType(e.getValue(), e.getKey()));
map.put("_" + e.getKey(), convertFieldType(e.getValue(), e.getKey()));
Hi,
In my humble opinion, there is an inconsistent within the treatment of the field type conversion.
The doc says: "You can configure a specific field to be converted to a numeric type. Key is the additional field key (and should thus begin with an underscore), value is the type to convert to. Currently supported types are int, long, float and double."
But this is only true when you set the flag "includeFullMDC" to true.
If you don't set the explicit flag, and you create explicit mapping for additional fields, then the field type conversion is in the form:
I think that this could be easily changed with a minimun change in the file GelfConverter.java to unified criteria: Proposed change (line 202) Replace: map.put(additionalFields.get(key), convertFieldType(field, key)); With: map.put(additionalFields.get(key), convertFieldType(field, additionalFields.get(key)));
Another aproach could be:
Replace (line 193 and line 195) map.put(additionalFields.get(e.getKey()), convertFieldType(e.getValue(), additionalFields.get(e.getKey()))); map.put("" + e.getKey(), convertFieldType(e.getValue(), "" + e.getKey()));
With map.put(additionalFields.get(e.getKey()), convertFieldType(e.getValue(), e.getKey())); map.put("_" + e.getKey(), convertFieldType(e.getValue(), e.getKey()));
But this impies also changing the main doc page.