Class RunMdcContext

java.lang.Object
com.agentforge4j.starter.logging.RunMdcContext
All Implemented Interfaces:
AutoCloseable

public final class RunMdcContext extends Object implements AutoCloseable
Stacks run, workflow, step, and agent identifiers into MDC; close() restores values that were present beforehand.

Keys correspond to fixed field names consumed by downstream logging pipelines.

  • Method Details

    • of

      public static RunMdcContext of(String runId, String workflowId, String stepId, String agentId)
      Puts identifiers into MDC, replacing blank strings with removals for the affected key.
    • close

      public void close()
      Restores earlier MDC values captured on first write of each key during this context.
      Specified by:
      close in interface AutoCloseable