Search code examples
wcfwcf-client

Dumping data reported by client to server to a Log file


I'm using WCF services in the client application for transfering data from client to server and vice-versa. I'm looking for a mechanism to log the data sent to server into the log file on client machine. I looked into the WCF library but could not find any code which serializes the WCF requests. Logging no issues, I use N-Log for that but I don't find any built in function which gives the webrequest data.

My question is, is there any built in support for getting the webrequest details?


Solution

  • The built in option is called Message logging but this option uses its own way to log messages using standard .NET trace listeners.

    If you want custom message logger you have to implement your own logging endpoint behavior with IClientMessageInspector.