comparison src/org/eclipse/jetty/server/handler/RequestLogHandler.java @ 997:7d28be82ab75

simplify Request
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 18 Oct 2016 22:43:17 -0600
parents 688c39c50ee3
children 32d4b569567c
comparison
equal deleted inserted replaced
996:d9cfec64899c 997:7d28be82ab75
59 */ 59 */
60 @Override 60 @Override
61 public void handle(String target, final Request baseRequest, HttpServletRequest request, final HttpServletResponse response) 61 public void handle(String target, final Request baseRequest, HttpServletRequest request, final HttpServletResponse response)
62 throws IOException, ServletException 62 throws IOException, ServletException
63 { 63 {
64 baseRequest.setDispatchTime(System.currentTimeMillis());
65
66 try 64 try
67 { 65 {
68 super.handle(target, baseRequest, request, response); 66 super.handle(target, baseRequest, request, response);
69 } 67 }
70 finally 68 finally
110 public Locale logLocale = Locale.getDefault(); 108 public Locale logLocale = Locale.getDefault();
111 public TimeZone timeZone = TimeZone.getTimeZone("GMT"); 109 public TimeZone timeZone = TimeZone.getTimeZone("GMT");
112 public boolean logLatency = false; 110 public boolean logLatency = false;
113 public boolean logCookies = false; 111 public boolean logCookies = false;
114 public boolean logServer = false; 112 public boolean logServer = false;
115 public boolean logDispatch = false;
116 113
117 private transient OutputStream _out; 114 private transient OutputStream _out;
118 private transient DateFormat dateFormat; 115 private transient DateFormat dateFormat;
119 private transient Writer _writer; 116 private transient Writer _writer;
120 117
215 } 212 }
216 buf.append('\"'); 213 buf.append('\"');
217 } 214 }
218 } 215 }
219 216
220 if (logDispatch || logLatency) 217 if (logLatency)
221 { 218 {
222 long now = System.currentTimeMillis(); 219 long now = System.currentTimeMillis();
223
224 if (logDispatch)
225 {
226 long d = request.getDispatchTime();
227 buf.append(' ');
228 buf.append(now - (d==0 ? request.getTimeStamp():d));
229 }
230 220
231 if (logLatency) 221 if (logLatency)
232 { 222 {
233 buf.append(' '); 223 buf.append(' ');
234 buf.append(now - request.getTimeStamp()); 224 buf.append(now - request.getTimeStamp());