Skip to content

Add a way to see a captured log event #206

@klitoskyriacou

Description

@klitoskyriacou

Let's say I have something like this in my production code:

var username = "fred";
MDC.put("user", username);
logger.warn("The user " + username + " has requested xyz");

I would like to be able to check that the message contains a string that matches a certain MDC key:

logCaptureListener.logged(aLog().withMdc("user", ???).withMessage(Mathers.containsString(<whatever was in Mdc>));

Perhaps this feature can be delivered in a similar way to Mockito's or Mockk's "capture" facitilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions