开发者

ELMAH Logging Variables

开发者 https://www.devze.com 2023-01-11 13:17 出处:网络
Does anyone know if there is a patch or anything kicking around for ELMAH that will extend its logging capabilities to include variables and/or session variables. Sometimes the errors i am logging are

Does anyone know if there is a patch or anything kicking around for ELMAH that will extend its logging capabilities to include variables and/or session variables. Sometimes the errors i am logging are hard to trace without a bit more info.

If there开发者_运维问答 is nothing i might have a go at altering myself

Cheers Luke


An issue like this exists on ELMAH site. There, Martin provides a patch that allows you to log exception Exception.Data variable.

Apply the patch (manually if your ELMAH version isn't the right one) and just add

ex.Data["yourInfoKey"]="yourInfoValue";

to your exception just before throwing it.

It worked for me.

However, if you want to add columns to your ELMAH_Error table to be able to filter on them, I'm afraid you'll have to edit ELMAH source yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消