質問

is there any message type I can specify in the Elmah settings? It seems it can only log errors but not normal messages.

Or is there any plug in for Elmah to handle that?

Thanks in advance!

役に立ちましたか?

解決

According to the post - ELMAH for simple logging from the Elmah Google Groups:

ELMAH is not a general purpose logging facility so I would discourage using it such. It is designed and therefore best suited for logging unhandled exceptions. You can however use ELMAH together with a general purpose logger

There are many general purpose logger available, like NLog, log4net, Enterprise Library, Common Logging, etc. I would suggest you look into some of these as solutions for general purpose logging. Some of these provide bridges for Elmah that you may be able to leverage.

他のヒント

You can manually call ELMAH to log an Exception. You should confirm however that this is the best solution to your issue.

HttpException foo = new HttpException(this.Response.StatusCode, this.Response.StatusDescription);
Elmah.ErrorSignal.FromCurrentContext().Raise(foo);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top