public void Dump() { Log.Info("Dump service debug info"); string debugFile = @"c:\f2b\dump.txt"; StreamWriter output = null; try { output = new StreamWriter(new FileStream(debugFile, FileMode.Append)); output.WriteLine("======================================================================"); output.WriteLine("Timestamp: " + DateTime.Now + " (UTC " + DateTime.UtcNow.Ticks + ")"); output.WriteLine("Subscribers:"); lock (thisSubscribersLock) { foreach (var item in subscribers) { MessageQueue mq = item.Key; output.WriteLine(mq.Path); } } output.WriteLine("QData:"); lock (thisQDataLock) { foreach (var item in qdata) { output.WriteLine(" expiration key: " + item.Key); FwData fwdata = new FwData(item.Value.Item1); fwdata.Debug(output); } } } catch (Exception ex) { Log.Error("Unable to dump debug info (" + debugFile + "): " + ex.ToString()); } finally { if (output != null) { output.Close(); } } }