diff options
author | Justin Clark-Casey (justincc) | 2012-09-20 23:18:19 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-20 23:18:19 +0100 |
commit | a5b3989e5db0a3b22e44b84412227a8e487bcef2 (patch) | |
tree | 31b2f0293de73d102f0f8d08975655cf993c8137 /OpenSim/Framework/WebUtil.cs | |
parent | Add ability to turn on/off logging of outgoing HTTP requests flowing through ... (diff) | |
download | opensim-SC_OLD-a5b3989e5db0a3b22e44b84412227a8e487bcef2.zip opensim-SC_OLD-a5b3989e5db0a3b22e44b84412227a8e487bcef2.tar.gz opensim-SC_OLD-a5b3989e5db0a3b22e44b84412227a8e487bcef2.tar.bz2 opensim-SC_OLD-a5b3989e5db0a3b22e44b84412227a8e487bcef2.tar.xz |
Insert a new log level 4 for HTTP IN and HTTP OUT that will log how long the request took.
This is only printed if debug http level >= 4 and the request didn't take more than the time considered 'long', in which case the existing log message is printed.
This displaces the previous log levels 4 and 5 which are now 5 and 6 respectively.
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 7c4e852..64d61f1 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -250,6 +250,10 @@ namespace OpenSim.Framework | |||
250 | strBuffer != null | 250 | strBuffer != null |
251 | ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) | 251 | ? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer) |
252 | : ""); | 252 | : ""); |
253 | else if (DebugLevel >= 4) | ||
254 | m_log.DebugFormat( | ||
255 | "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", | ||
256 | reqnum, tickdiff, tickdata); | ||
253 | } | 257 | } |
254 | 258 | ||
255 | m_log.DebugFormat( | 259 | m_log.DebugFormat( |
@@ -405,6 +409,10 @@ namespace OpenSim.Framework | |||
405 | queryString != null | 409 | queryString != null |
406 | ? (queryString.Length > MaxRequestDiagLength) ? queryString.Remove(MaxRequestDiagLength) : queryString | 410 | ? (queryString.Length > MaxRequestDiagLength) ? queryString.Remove(MaxRequestDiagLength) : queryString |
407 | : ""); | 411 | : ""); |
412 | else if (DebugLevel >= 4) | ||
413 | m_log.DebugFormat( | ||
414 | "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", | ||
415 | reqnum, tickdiff, tickdata); | ||
408 | } | 416 | } |
409 | 417 | ||
410 | m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage); | 418 | m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage); |
@@ -879,6 +887,12 @@ namespace OpenSim.Framework | |||
879 | tickdata, | 887 | tickdata, |
880 | originalRequest); | 888 | originalRequest); |
881 | } | 889 | } |
890 | else if (WebUtil.DebugLevel >= 4) | ||
891 | { | ||
892 | m_log.DebugFormat( | ||
893 | "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", | ||
894 | reqnum, tickdiff, tickdata); | ||
895 | } | ||
882 | } | 896 | } |
883 | } | 897 | } |
884 | 898 | ||
@@ -995,6 +1009,10 @@ namespace OpenSim.Framework | |||
995 | tickdiff, | 1009 | tickdiff, |
996 | tickdata, | 1010 | tickdata, |
997 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); | 1011 | obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj); |
1012 | else if (WebUtil.DebugLevel >= 4) | ||
1013 | m_log.DebugFormat( | ||
1014 | "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", | ||
1015 | reqnum, tickdiff, tickdata); | ||
998 | 1016 | ||
999 | return respstring; | 1017 | return respstring; |
1000 | } | 1018 | } |
@@ -1144,6 +1162,12 @@ namespace OpenSim.Framework | |||
1144 | tickdata, | 1162 | tickdata, |
1145 | originalRequest); | 1163 | originalRequest); |
1146 | } | 1164 | } |
1165 | else if (WebUtil.DebugLevel >= 4) | ||
1166 | { | ||
1167 | m_log.DebugFormat( | ||
1168 | "[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing", | ||
1169 | reqnum, tickdiff, tickdata); | ||
1170 | } | ||
1147 | 1171 | ||
1148 | return deserial; | 1172 | return deserial; |
1149 | } | 1173 | } |