views:

16

answers:

1

I am communicating between two processes using WCF. By default this produces very obscure and simple error messages when something goes wrong which are not very helpful.

On http://msdn.microsoft.com/en-us/library/aa702726.aspx I found out how I can enable more detailed logging. Unfortunately this seems rather static. I would like to do and configure this from code (keep 10 "old" files, specify the path where to store the log files when the application starts...) but so far I have not found any decent examples.

Is it even possible to do this from code and can someone give any pointers on how and what I need to do?

A: 

I don't think it is "possible". Message logging is based on static MessageLogger class from System.ServiceModel.Diagnostics namespace. This class is internal and it is initialized (from config file) in private OnBeginOpen method of ServiceHostBase.

Ladislav Mrnka
That's a bummer. I am working with two standalone desktop applications and the only way I can really enable detailed logging is by doing it myself from code.
tyfius