Skip to content

Using MDC (Mapped Diagnostic Context) to improve logging #37

Closed
@csviri

Description

@csviri

In order to make it easy to work with logs, thus correlate log messages within an operator (1 process) we could add "correlation ids" or data (note this is not the same as we add correlation IDs in distributed systems) or more like the mapped diagnostic context:
see: https://www.baeldung.com/mdc-in-log4j-2-logback
to the logs. So we can correlate logs for the custom resource, but also for a reconciliation execution path. Note that this involves multiple threads, so its not just using directly MDC.

So we can add to for every log message with MDC:

  • resource uuid
  • resource version
  • generated uuid for every reconciliation (so we can see which log messages are related to a particular reconciliation)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions