Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] problem logging requests that have spawned continuations


I have a problem in that in all my logs the response code 200 is logged even if a HTTP request eventually fails with say a 50x response. Currently I'm using the normal NCSARequestLog class like so:-

    <Ref id="RequestLog">
      <Set name="requestLog">
        <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
          <Set name="filename"><Property name="jetty.home" default="."/>/logs/yyyy_mm_dd.request.log</Set>
          <Set name="filenameDateFormat">yyyy_MM_dd</Set>
          <Set name="retainDays">90</Set>
          <Set name="append">true</Set>
          <Set name="extended">false</Set>
          <Set name="logCookies">false</Set>
          <Set name="LogTimeZone">GMT</Set>

And in processing request we create a continuation and suspend the request.

  final AsyncContinuation continuation = (AsyncContinuation) ContinuationSupport.getContinuation(request);
  // suspend the request
  continuation.suspend(response); // response may be wrapped.

and so forth. I assume because the request is suspended and continuation takes over, is why the log only shows 200 responses.  Are there any utilities in jetty to also log these continued request/responses?

Any help much appreciated.


Back to the top