Log this request.
@param req Request
@throws IOException If fails
504883
private static void log(final RqFallback req) throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final Throwable error = req.throwable();
        try (PrintStream stream = new Utf8PrintStream(baos, false)) {
            error.printStackTrace(stream);
        }
        Logger.getLogger(FbLog4j.class).error(
            String.format(
                "%s %s failed with %s: %s",
                new RqMethod.Base(req).method(),
                new RqHref.Base(req).href(),
                req.code(),
                baos.toString("UTF-8")
            )
        );
    }
505980
public void doProgressiveLog( StaplerRequest req, StaplerResponse rsp) throws IOException {
        AnnotatedLargeText text = obtainLog();
        if(text!=null) {
            text.doProgressText(req,rsp);
            return;
        }
        rsp.setStatus(HttpServletResponse.SC_OK);
    }
554080
public void handleRequest(String request) {
        if (messageListener != null) {
            log.debug("Received Http request");
            messageListener.onInboundMessage(new RawMessage(request), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Received Http request:" + NEWLINE + request);
            }
        }
    }
64843
private static Request consume(final Request req) throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        new RqPrint(req).printBody(baos);
        return new Request() {
            @Override
            public Iterable<String> head() throws IOException {
                return req.head();
            }

            @Override
            public InputStream body() {
                return new ByteArrayInputStream(baos.toByteArray());
            }
        };
    }
171874
private static void logResponse(StatusUpdate response) {
		String text = response.getStatus();
		String message = String.format(MESSAGE_RESPONSE, text);
		System.out.println(message);
	}
1204049
@SuppressWarnings("unused")
  private static final void dump(HttpClient client, HttpUriRequest req) {
    if (logger.isTraceEnabled()) {
      StringBuilder sb = new StringBuilder("\n=== Request ===");
      sb.append("\n").append(req.getRequestLine());
      for (Header h : req.getAllHeaders()) {
        sb.append("\n").append(h.getName()).append(": ").append(h.getValue());
      }
      logger.trace(sb.toString());
      
      HttpResponse resp = null;
      try {
        resp = client.execute(req);
      } catch (Exception e) {
        logger.trace("Error executing request", e);
        return;
      }
      
      sb = new StringBuilder("\n=== Response ===");
      sb.append("\n").append(resp.getStatusLine());
      for (Header h : resp.getAllHeaders()) {
        sb.append("\n").append(h.getName()).append(": ").append(h.getValue());
      }
      logger.trace(sb.toString());
      
      HttpEntity entity = resp.getEntity();
      if (entity != null) {
        sb = new StringBuilder("\n=== Content ===");
        try {
          int len = (int) entity.getContentLength();
          if (len < 0) len = 100;
          ByteArrayOutputStream baos = new ByteArrayOutputStream(len);
          entity.writeTo(baos);
          sb.append("\n").append(baos.toString("UTF-8"));
          logger.trace(sb.toString());
        } catch (IOException e) {
          logger.trace("Error reading content", e);
        }
      }
    }
  }
740508
private void dumpRequest(final HttpServletRequestLoggingWrapper request, final int id) {
        final StringWriter stringWriter = new StringWriter();
        final PrintWriter printWriter = new PrintWriter(stringWriter);
        if ((request.getRemoteUser() == null) || (request.getRemoteUser().trim().length() == 0)) {
            printWriter.print("Not authenticated");
        } else {
            printWriter.print("Authenticated as ");
            printWriter.println(request.getRemoteUser());
        }
        printWriter.print("-- ID: ");
        printWriter.println(id);
        printWriter.print(request.getMethod());
        printWriter.print(" ");
        printWriter.print(request.getRequestURL());
        printWriter.print(" ");
        printWriter.println(request.getProtocol());
        if (LOG_HEADERS.isDebugEnabled()) {
            @SuppressWarnings("unchecked")
            final Enumeration<String> headerNames = request.getHeaderNames();
            while (headerNames.hasMoreElements()) {
                final String key = headerNames.nextElement();
                @SuppressWarnings("unchecked")
                final Enumeration<String> headerValues = request.getHeaders(key);
                printWriter.print(key);
                printWriter.print(": ");
                while (headerValues.hasMoreElements()) {
                    printWriter.print(headerValues.nextElement());
                    printWriter.println();
                    if (headerValues.hasMoreElements()) {
                        printWriter.print(' ');
                    }
                }
            }
        }
        printWriter.println("-- Begin request body");
        final String body = request.getBody();
        if (body == null || body.length() == 0) {
            printWriter.println("-- NO BODY FOUND IN REQUEST");
        } else {
            printWriter.println(body);
        }
        printWriter.println("-- End request body");
        printWriter.flush();
        LOG_REQUEST.debug(stringWriter.toString());
    }
694764
public void log(Level level, String loggerFqcn, Object message, Throwable t) {
        doLog(level, loggerFqcn, message, null, t);
    }
502476
def log_request(self, code='-', size='-'):
        """"""

        if self.server.logRequests:
            BaseHTTPServer.BaseHTTPRequestHandler.log_request(self, code, size)
523172
function logger (req, res, next) {
    var now = new Date();

    function logRequest()
    {
        var ok = 200 <= res.statusCode && res.statusCode <= 400;
        if (ok && config.methods.indexOf(req.method) < 0)
            return;
            
        var audit = {
            who: config.user(req),
            when: now.toISOString(),
            where: {
                client: req.ip || req._remoteAddress || (req.connection ? req.connection.remoteAddress : undefined),
                host: req.headers.host,
                server: config.hostname
			},
            why: req.method,
            what: (req.method == 'POST') ? res._headers['location'] : req.url,
            status: res.statusCode,
        };
        sally.log(audit);
    }
    
    onFinished(res, logRequest);
    next();
}
1017526
protected void doBye(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException{
    	if (req.isInitial())
			notHandled(req);
    }
846024
protected void writeLogging(Definition def, Writer out, int indent, String level, String content, String... params)
         throws IOException
   {
      writeIndent(out, indent);
      if (def.isSupportJbossLogging())
      {
         out.write("log.trace");
         int size = params.length;
         if (size > 0)
            out.write("f");
         out.write("(\"" + content + "(");
         for (int i = 0; i < size; i++)
         {
            out.write("%s");
            if (i < size - 1)
               out.write(", ");
         }
         out.write(")\"");
         for (int i = 0; i < size; i++)
         {
            out.write(", ");
            out.write(params[i]);
         }
         out.write(");");
      }
      else
      {
         out.write("log.finest(\"" + content + "()\");");
      }
      writeEol(out);
   }
441133
@SuppressWarnings("PMD.AvoidCatchingThrowable")
    private void print(final Request req, final OutputStream output)
        throws IOException {
        try {
            new RsPrint(this.take.act(req)).print(output);
        } catch (final HttpException ex) {
            new RsPrint(BkBasic.failure(ex, ex.code())).print(output);
            // @checkstyle IllegalCatchCheck (7 lines)
        } catch (final Throwable ex) {
            new RsPrint(
                BkBasic.failure(
                    ex,
                    HttpURLConnection.HTTP_INTERNAL_ERROR
                )
            ).print(output);
        }
    }
1176001
protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
            throws IOException {
        // TODO put this html code in a template
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        response.setStatus(200);
        FileBackedStringBuffer buffer = new FileBackedStringBuffer();

        buffer.append("<html><head><title>");
        buffer.append(request.getRemoteHost());
        buffer.append("</title><script type=text/javascript>");
        buffer.append("function submitform() { document.myform.submit(); } </script>");
        buffer.append("</head><body><H1>View Logs on - ");
        buffer.append(request.getRemoteHost()).append("</H1>");

        if (isLogsDirectoryEmpty()) {
            buffer.append("<br>No Logs available.</br></body></html>");
            dumpStringToStream(buffer, response.getOutputStream());
            return;
        }
        buffer.append(appendMoreLogsLink(fileName, request.getRequestURL().toString()));
        buffer.append(renderLogFileContents(fileName));
        buffer.append("</body></html>");
        dumpStringToStream(buffer, response.getOutputStream());
    }
821061
def log_request(self, code="-", size="-"):
        
        self._service.log(logging.DEBUG, '"%s" %s', self.requestline, code)
138085
function loggingMiddleware(req, res, next) {
  logRequest(req, res);
  setupResponseInterceptors(req, res);
  next();
}
1218920
public void doLogout(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        if (!common.checkPost(request, response)) return;
        request.getSession().removeAttribute("logged-in-username");
        response.sendRedirect("/");
    }