Delay calling do_log until just before emitting the response. This avoids calling do_log before potentially handing control to the static-index handler, which also calls do_log.