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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With