views:

96

answers:

1

I have developed my own custom provider for the health monitoring; however, I use parameters in the constructor and this is not allowed when using the health monitoring from the web.config file.

Does anyone know if I can turn on/off the monitoring and have it watch properly through code (possibly in my global.asax file on application startup).

Or, is it possible for me to create my own watcher that will do the same thing as the health monitor.

Or, finally - can I just pass variables from the web.config setup (i'm not familiar with the public token part of the provider type declaration).

Thanks in advance

A: 

I don't know if there are any other better ideas out there... after a lot of reading and trying I ended up using parameters in the provider to pass information into a custom bufferedwebeventprovider.

If you create a custom provider and include the override Initialize(name, config) method then all of your parameters from your web.config file will come through the config param of the Initialize command. Then in the initialize command you can pull them off one by one (and remove them) before passing the rest of the config property to the base.Initialize method.

I used this to save and pull off connection string info, timeouts, custom id's, etc.

I would still like to know anyway to control the health monitoring without having all of the info in the web.config (mostly because this is a database driven website with multiple users and multiple different settings). I'll probably end up having a procedure within the custom provider to check settings and only record entries as needed based on each user's settings.

any other thoughts are very welcome!!

Adam