Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-480

When using `parallelStream()` function to do something, MDC does not work.

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • None
    • None

    Description

      I need to log a few attributes of the request like the request id and the locale, but when using parallelStream, it seems that the ThreadLocal of the MDC looses the information.

      Ive analyzed the solution of passing the MDC context between the threads when creating the parallelStream but it seems dirty and I also have a lot of usages of the parallelStream.

      Is there any other way of doing this?

      Thank you

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            HollySn Liu Cong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: