Example #1
0
        public static void LogMessage(ref System.ServiceModel.Channels.Message msg)
        {
            int    messageLogFileIndex = 0;
            string messageFileName     = string.Format("{0}{1:000}_" + logFileName, logDirectory, System.Threading.Interlocked.Increment(ref messageLogFileIndex));

            using (StreamWriter sw = File.CreateText(messageFileName)) {
                if (!msg.IsEmpty)
                {
                    sw.WriteLine(MessageUtility.MessageToString(ref msg));
                }
            }
        }