I would like to add meta data fields that are numeric to Graylog2 by using the MDC context so that I can search on these fields as numbers and not strings.
Basically we have log statements that set the time that something took in the MDC context as well as other numeric metrics. The current implementation always converts MDC context fields into strings which is actually more or less the right thing to do since SLF4J only supports Strings in the MDC. However I would like to convert those numeric Strings back into numbers by extending the Appender to handle my special fields.
I tried to make as minimal change as I could while also providing a unit test.
I would like to add meta data fields that are numeric to Graylog2 by using the MDC context so that I can search on these fields as numbers and not strings.
Basically we have log statements that set the time that something took in the MDC context as well as other numeric metrics. The current implementation always converts MDC context fields into strings which is actually more or less the right thing to do since SLF4J only supports Strings in the MDC. However I would like to convert those numeric Strings back into numbers by extending the Appender to handle my special fields.
I tried to make as minimal change as I could while also providing a unit test.