Ignorant Remoting Question

Ignorant Remoting Question

Old forum URL: forums.lhotka.net/forums/t/298.aspx


razorkai posted on Wednesday, June 07, 2006

Hi guys.

Just wondering, would it be possible to add a method to the RemotingHost that would enable me to connect to it and add/remove a TraceListener?  We are currently outputing (is that a word?) lots of information using a custom TraceListener but we don't want it being output all the time.  I know you can add/remove listeners via the web.config file but this is not ideal when you have multiple servers.  The ideal scenario would be to connect to the server process and turn on/off tracing on demand but I can't find out if it is possible.

Thanks for any help/input.

John.

RockfordLhotka replied on Wednesday, June 07, 2006

If you are hosting in IIS (which I recommend), then you should be able to do this without even touching RemotingHost. You can add an asmx or another remoting endpoint to that same virtual root.

The real challenge is whether you can dynamically add a TraceListener, and that I don't know. But adding an asmx and associated code file to your virtual root is a very easy way to accomplish your goal, because then you'll just have a public web service against which you can write an admin client tool.

razorkai replied on Wednesday, June 07, 2006

This is interesting as we are hosting in IIS.  You can dynamically add/remove TraceListeners at runtime in a winforms app, so I am hoping the concept will work.  So if I added a webservice to my virtual root that allowed me to do this, would the dataportal calls see the change?  I am guessing that depends on the scope of the TraceListeners collection.  I'll give it a go!

Thanks.

Copyright (c) Marimer LLC