I created a WCF service where the class ServiceHost cannot be instantiated as a Singleton. I need to monitor every connection to this service, even before the first call to the methods associated with it. In practice, I would like to log when a client opens a channel to communicate with the service. Is it possible? In the web I find only two kinds of solutions:
- The ServiceHost object must be instantiated by the server and used as a singleton. Then I have to provide an initial method called by client to register itself to the service.
- Use performance monitor to show counters related to the service.
Neither (1) nor (2) satisfy my needs, because I want to create my own application and, as I said before, I cannot use the singleton mode. Have you ever encountered this kind of problem? How did you manage it?
Last, but not least, I need also to monitor calls to each method provided by the service. Is there a way to do that? Any help will be appreciated.