Elmah add message to error logged through call to Raise(e)

后端 未结 2 2049
天命终不由人
天命终不由人 2021-02-07 22:11

I\'m a bit confused at how to add a message to an error logged programatically with ELMAH.

eg:

public ActionResult DoSomething(int id)
{
    try { ... }
         


        
2条回答
  •  我寻月下人不归
    2021-02-07 22:43

    I found that I can also do something like:

    Elmah.ErrorSignal.FromCurrentContext().Raise(new NotImplementedException("class      FbCallback.Page_Load() Request.Url= " + Request.Url));
    

    To log my own messages. Then in when I browse to

    http://localhost:5050/elmah.axd
    

    I see my messages as type NotImplementedException. Not very pretty but works.

提交回复
热议问题