With camunda 7.12, Contextual Logging for Processes has been implemented. Some values are automatically added to the logging MDC. But the name of the current activity (not its id!) is not listed among the configurable parameters. Does this mean that it is not added to the MDC? If yes: why was it omitted?
Hi @fml2,
in contrast to the activity id, the activity name is not contained in the execution object at runtime.
In order to add it to the MDC, we would need to fetch it from the process model.
In cases where the process model is not already loaded into the cache when the process is executed, this can be become a resource-intensive operation. This is one of the reasons why we did not initially add it to the list.
You are of course welcome to add a feature request to our Issue Tracker and to open a PR adding this functionality.
Hope that helps.
Best,
Tobias
But one could add this possibility and configure the MDC for it to ‘null’ per default. So that per default it is not retrieved. But if someone wants to have it (performance does not matter), then it could be added easily – just by setting the MDC entry name in the engine config.
Thank you for the quick reply BTW. I appreciate the core camunda devs writing here!
I think it would be better if you think of à enrichment pipeline for your logs, and you get this info from your cached parsed BPMN definitions. The logs should be as quick as possible, and you enrich in your logging processor pipeline
Could you please elaborate more on this? Which logging processor pipeline do you mean? Also: I don’t parse any BPMN definitions and don’t cache them (explicitly).