【发布时间】:2012-02-17 09:58:25
【问题描述】:
我在处理我的网络应用程序中的文件上传的 ashx 页面上遇到很多超时。有没有办法可以捕获超时并记录一些有关上传的数据,以帮助我更好地了解问题所在?
记录器看起来像这样,我只需要将它附加到超时异常!
Private Sub LogTimeoutException(context As HttpContext)
'Gather the data
Dim sb As New StringBuilder()
sb.AppendLine(String.Format("Toal files: {0}", context.Request.Files.Count))
For Each f As HttpPostedFile In context.Request.Files
sb.AppendLine(String.Format("{0} ({1}): {2}", f.FileName, f.ContentType, f.ContentLength))
Next
'Log it
Dim l As New BitFactory.Logging.FileLogger(context.Server.MapPath("~/timeoutlog.txt"))
l.LogInfo(sb.ToString())
End Sub
【问题讨论】:
标签: asp.net web-services file-upload timeout ashx