.net - How could I still log with asp.net healthMonitoring an Exception that was Catch? -


I have configured health monitoring in my web application to log all exceptions to the database.

But, when I honestly handled some exceptions by showing a good message to the user, they are not logged into the database. If I find something like throw x , the standard error page is displayed and the error is not handled brilliantly.

At the end of my error handler, can I add something more to tell the system to log this error?

Here is a code sample:

  Try string = "do something" as a slow error text, catch some exceptions as dataActionAir. Text = string.format ("a problem {0}.", Error text) data connection error. ? And try on the web   

and the health monitoring section of my web.config:

  & lt; Health Monitoring Enabled = "Truth" & gt; & Lt; EventMappings & gt; & Lt; Clear /> & Lt; Add name = "all errors" type = "System.Web.Management.WebBaseErrorEvent" startEventCode = "0" endEventCode = "2147483647" /> & Lt; / EventMappings & gt; & Lt; Providers & gt; & Lt; Clear /> & Lt; Add connection StringName = "MyConnectionString" maxEventDetailsLength = "1073741823" buffer = "wrong" name = "SqlWebEventProvider" type = "System.Web.Management.SqlWebEventProvider" /> & Lt; / Providers & gt; & Lt; Rules & gt; & Lt; Clear /> & Lt; Add name = "all errors in database" eventName = "all errors" provider = "SqlWebEventProvider" profile = "default" minInstances = "1" maxLimit = "infinite" minInterval = "00:00:00" /> & Lt; / Rules & gt; & Lt; / HealthMonitoring & gt;    

You can increase your own events which will then be consumed by providers.
You can not increase your WebBaseErrorEvent , but you can create a custom web event and zoom your configuration to capture it too. See



Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -