Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/NCSARequestLog.java @ 832:2afcb04f56a4
remove NCSARequestLog._ignorePaths
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 16 Sep 2016 00:35:35 -0600 |
parents | 8e9db0bbf4f9 |
children | 175577dab6d8 |
comparison
equal
deleted
inserted
replaced
831:86338c0029a9 | 832:2afcb04f56a4 |
---|---|
70 private boolean _preferProxiedForAddress; | 70 private boolean _preferProxiedForAddress; |
71 private String _logDateFormat = "dd/MMM/yyyy:HH:mm:ss Z"; | 71 private String _logDateFormat = "dd/MMM/yyyy:HH:mm:ss Z"; |
72 private String _filenameDateFormat = null; | 72 private String _filenameDateFormat = null; |
73 private Locale _logLocale = Locale.getDefault(); | 73 private Locale _logLocale = Locale.getDefault(); |
74 private String _logTimeZone = "GMT"; | 74 private String _logTimeZone = "GMT"; |
75 private String[] _ignorePaths; | |
76 private boolean _logLatency = false; | 75 private boolean _logLatency = false; |
77 private boolean _logCookies = false; | 76 private boolean _logCookies = false; |
78 private boolean _logServer = false; | 77 private boolean _logServer = false; |
79 private boolean _logDispatch = false; | 78 private boolean _logDispatch = false; |
80 | 79 |
81 private transient OutputStream _out; | 80 private transient OutputStream _out; |
82 private transient OutputStream _fileOut; | 81 private transient OutputStream _fileOut; |
83 private transient DateCache _logDateCache; | 82 private transient DateCache _logDateCache; |
84 private transient PathMap _ignorePathMap; | |
85 private transient Writer _writer; | 83 private transient Writer _writer; |
86 | 84 |
87 /* ------------------------------------------------------------ */ | 85 /* ------------------------------------------------------------ */ |
88 /** | 86 /** |
89 * Create request log object with default settings. | 87 * Create request log object with default settings. |
292 return _append; | 290 return _append; |
293 } | 291 } |
294 | 292 |
295 /* ------------------------------------------------------------ */ | 293 /* ------------------------------------------------------------ */ |
296 /** | 294 /** |
297 * Set request paths that will not be logged. | |
298 * | |
299 * @param ignorePaths array of request paths | |
300 */ | |
301 public void setIgnorePaths(String[] ignorePaths) | |
302 { | |
303 _ignorePaths = ignorePaths; | |
304 } | |
305 | |
306 /* ------------------------------------------------------------ */ | |
307 /** | |
308 * Retrieve the request paths that will not be logged. | |
309 * | |
310 * @return array of request paths | |
311 */ | |
312 public String[] getIgnorePaths() | |
313 { | |
314 return _ignorePaths; | |
315 } | |
316 | |
317 /* ------------------------------------------------------------ */ | |
318 /** | |
319 * Controls logging of the request cookies. | 295 * Controls logging of the request cookies. |
320 * | 296 * |
321 * @param logCookies true - values of request cookies will be logged, | 297 * @param logCookies true - values of request cookies will be logged, |
322 * false - values of request cookies will not be logged | 298 * false - values of request cookies will not be logged |
323 */ | 299 */ |
461 */ | 437 */ |
462 public void log(Request request, Response response) | 438 public void log(Request request, Response response) |
463 { | 439 { |
464 try | 440 try |
465 { | 441 { |
466 if (_ignorePathMap != null && _ignorePathMap.getMatch(request.getRequestURI()) != null) | |
467 return; | |
468 | |
469 if (_fileOut == null) | 442 if (_fileOut == null) |
470 return; | 443 return; |
471 | 444 |
472 StringBuilder buf= _buffers.get(); | 445 StringBuilder buf= _buffers.get(); |
473 buf.setLength(0); | 446 buf.setLength(0); |
662 else | 635 else |
663 _fileOut = System.err; | 636 _fileOut = System.err; |
664 | 637 |
665 _out = _fileOut; | 638 _out = _fileOut; |
666 | 639 |
667 if (_ignorePaths != null && _ignorePaths.length > 0) | |
668 { | |
669 _ignorePathMap = new PathMap(); | |
670 for (int i = 0; i < _ignorePaths.length; i++) | |
671 _ignorePathMap.put(_ignorePaths[i],_ignorePaths[i]); | |
672 } | |
673 else | |
674 _ignorePathMap = null; | |
675 | |
676 synchronized(this) | 640 synchronized(this) |
677 { | 641 { |
678 _writer = new OutputStreamWriter(_out); | 642 _writer = new OutputStreamWriter(_out); |
679 } | 643 } |
680 super.doStart(); | 644 super.doStart(); |