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

Log4j2 should not automatically start in Servlet 3.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0-beta9
    • 2.0-rc1
    • Filters
    • 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. patch_async.diff
          17 kB
          Anthony Communier
        2. log4-servlet-test.zip
          1.87 MB
          Anthony Communier
        3. 0002-Add-async-support-to-Log4jServletFilter.patch
          33 kB
          Matt Sicker
        4. 0001-Add-LOGGER_CONTEXT_ATTRIBUTE-to-LoggerContext.patch
          1 kB
          Matt Sicker

        Activity

          People

            beamerblvd Nick Williams
            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