tags:

views:

81

answers:

2

I have two processes that I have up and running and I am doing logging from. One is a client the other is a webservice. I want to setup a central log system where I can track logs and interactions between processes -- for instance I want to be able to associate calls made from the client to the webservice when I look at the logs. I guess this means that somehow the processid of the client process needs to flow over to the webservice in some way for it to be trackable?

Is this possible with current logging frameworks such as Enterprise Library or Log4Net? Is there anyone that has looked into something like this?

Any help would be appreciated.

If you have a more defining term for this please feel free to change the title of the question or tags.

A: 

You should be able to do this easily with the .Net Enterprise Library Logging Application Block. This will allow you to log to the same database/table from both processes.

As for connecting one process to the next, yes - you will need to create some sort of unique ID in the calling process and pass it to the process being called. Then you can log that value from the caller, right before you make the call, and log it from the callee right at the beginning of the call.

I would recommend that you use a separate logging level for interprocess communications. I've often logged such communications as Notice messages. This makes it easy to filter them out from the rest of the messages in the log.

Petey
Thanks for the answer. I am wondering in what way I could communicate the guid from one process to the other. It seems dirty to add a parameter to every method of every webservice. Is it possible to do this out of bounds somehow?
Fadeproof
Off the top of my head, I can't think of an easy way to do this out of bounds. However, I'm not sure that I would pass around a GUID. A GUID seems like overkill. Depending on your inter-process traffic volume, perhaps a simple counter would suffice (perhaps gen'ed by a DB?).
Petey
A: 

To collect and store logging data in a central location, you usually need some kind of logging server or receiver application (especially if you want to write to a single log file concurrently and still maintain good performance). You might want to give our logging tool SmartInspect a try, as it comes with a logging server that can receive logging data from multiple process/machines. SmartInspect also comes with a viewer application for analyzing and filtering logging data.

Dennis G.