Question
How to read MDC fields using custom appender
All,
We are trying to implement a custom appender to send our log messages to a log-aggregation tool (ie, Splunk). In order to do this, we had to extend the pega log4j classes and load our custom logging classes into pega.
This part works perfectly, and we are able to send our log messages and associated stack traces to our log aggregator. Our hangup right now is being able to read the values in the MDC hash map that store useful info thats not part of the raw log message (pegathread,userid, requestorid, etc..)
We are trying to read these values by calling the MDC.get() method, however it always returns null values. Is there a different method/function we should be calling to read these MDC values?
Thanks!
-Jon
***Updated by Moderator: Marissa to add SR Details***
Jon,
How did you put pegathread, etc to MDC map? Have you tried to put in a hard-coded value and call MDC.get("name") to see if the original hard-coded value can be read?