我在 Elmah 中记录我的错误,ErrorLog.GetDefault
因为我想使用 ErrorId。但是,当我这样做时,服务器变量不包含在日志条目中。谁能解释为什么,如果可能的话,如何解决这个问题?
public void LogExceptionToElmah(Exception exception)
{
//Includes Server Variables
ErrorSignal.FromContext(HttpContext.Current).Raise(exception);
//Does not include Server Variables
var elmahId = Elmah.ErrorLog.GetDefault(HttpContext.Current).Log(new Error(exception));
}