Skip to content

add support for peekByKey in MDC #461

Open
@youjie23

Description

@youjie23

In some scenarios, after using MDC.pushByKey(key, value) to push a value into the deque (stack), we may need to retrieve the top value without popping the stack referenced by 'key', similar to a ​​peekByKey​​ operation. However, the current SLF4J implementation requires developers to invoke getCopyOfDequeByKey(key) and manually peek from the returned deque (stack), which involves creating a copy of the data structure and leads to unnecessary performance overhead. Would it be more efficient to add native support for peekByKey in MDC to avoid this redundancy?

Thank you for your attention and support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions