Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-452

Log4j2 should not automatically start in Servlet 3.0

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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.

        Attachments

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

          Activity

            People

            • Assignee:
              beamerblvd Nick Williams
              Reporter:
              anthonyC 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