Log4j 2
  1. Log4j 2
  2. LOG4J2-452

Log4j2 should not automatically start in Servlet 3.0

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: 2.0-rc1
    • Component/s: Filters
    • Labels:
      None

      Description

      When using async servlet (async-supported=true inweb.xml), log4j2 breaks the async chain because it does not support async. All element in the chain must support async in order to use async. Using Log4j2 in web context lead to be unable to use async.

      Be aware that async mecanism is more complicated than just intercept the chain before and after the handling of the request (thing that could be done in sync context). When using async mecanism web container threads can be used when the start method is invoked on AsyncContext and there are no way to intercept this systematically.

      So I m not sure that it's a good idea to automatically intercept request with a filter.

      1. patch_async.diff
        17 kB
        Anthony Communier
      2. log4-servlet-test.zip
        1.87 MB
        Anthony Communier
      3. 0001-Add-LOGGER_CONTEXT_ATTRIBUTE-to-LoggerContext.patch
        1 kB
        Matt Sicker
      4. 0002-Add-async-support-to-Log4jServletFilter.patch
        33 kB
        Matt Sicker

        Activity

        Anthony Communier created issue -
        Anthony Communier made changes -
        Field Original Value New Value
        Attachment patch_async.diff [ 12613861 ]
        Attachment log4-servlet-test.zip [ 12613862 ]
        Matt Sicker made changes -
        Nick Williams made changes -
        Assignee Nick Williams [ beamerblvd ]
        Nick Williams made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Nick Williams made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 2.0-rc1 [ 12325011 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Nick Williams
            Reporter:
            Anthony Communier
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 466h
              466h
              Remaining:
              Remaining Estimate - 466h
              466h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development