Reputation: 5605
I've developed a WCF service that I self hosted in a console application during development, then more recently deployed in IIS on the server. The console application provided a useful view of what was happening in the system at that point in time, and I would like to replicate that now that I am hosting the service in IIS.
The easiest way I can see to do this would be to develop a new console application whose sole job is to receive a message and output it. I can then update my WCF service's log method to send the message to the new application.
I don't want the console application to always be turned on. I want to start it whenever I need to monitor the current status of the system, but leave the service running if I close the console.
Any thoughts on how best to achieve this? I was thinking another self hosted WCF service, and perhaps just have the main service ping "localhost:8080/ConsoleLogger?message=abc". Seems a bit messy though, and not extendible (like having the output on a webpage instead of the console so I can see it over a network).
Any thoughts or suggestions?
Upvotes: 1
Views: 971
Reputation: 5605
I found the answer here:
http://www.paulrohde.com/building-a-really-simple-wcf-p2p-application/
It's a great tutorial on creating a simple pier to pier chatroom, which is easily adapted to suit my purposes, allowing me to connect a console application to the server and monitor from multiple machines.
Upvotes: 0
Reputation: 454
You can use WCF broadcasting for that, subscribe different clients to it to receive messages. http://msdn.microsoft.com/en-us/library/bb756931.aspx
Upvotes: 2