0
votes

I have a .NET service with a WCF host that uses Nlog for logging. I also have a WPF client that acts as a WCF client for the .NET service. The .NET services logs all message to a file (for now).

I want to use the client to output the current logged messages (ie, if a logging occurs while the client is open, then it'll be showed in a textbox for instance). If the client is closed, I don't need to see the messages.

I've thought of several ideas, but I'm not sure how good they are:

  • I could set up another host on the client that can receives messages from the Service.
  • MSMQ (with or without WCF), but then I think it'll just keep adding messages, which I don't want.
  • I could just open the Logfile itself, but I don't know which one will be the active logfile (seeing as this is handled by Nlog)

Are there any other ideas? Is there a better way for such communication between a (Windows) service and a client?

1

1 Answers

0
votes

You might want to look into SignalR. Here's an example that does something like what you are after to display WF tracking records in a browser: http://blog.petegoo.com/2011/10/02/workflow-service-tracking-viewer/.