开发者

Is it possible to programmatically control c# health monitoring without using the web.config file?

开发者 https://www.devze.com 2022-12-26 18:04 出处:网络
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.

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开发者_Go百科 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


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!!

0

精彩评论

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