protected void ErrorLog_Filtering(object sender, Elmah.ExceptionFilterEventArgs e) { var request = System.Web.HttpContext.Current.Request; var auth = request.ServerVariables["HTTP_AUTHORIZATION"]; if (!String.IsNullOrEmpty(auth)) { var authPattern = new Regex(@"(Authorization|HTTP_AUTHORIZATION):\s*" + auth + @"\s*", RegexOptions.ExplicitCapture); request.ServerVariables["ALL_HTTP"] = authPattern.Replace(request.ServerVariables["ALL_HTTP"], String.Empty); request.ServerVariables["ALL_RAW"] = authPattern.Replace(request.ServerVariables["ALL_RAW"], String.Empty); } request.ServerVariables["AUTH_PASSWORD"] = null; request.ServerVariables.Remove("AUTH_PASSWORD"); request.ServerVariables["HTTP_AUTHORIZATION"] = null; request.ServerVariables.Remove("HTTP_AUTHORIZATION"); }