private void BuildTrace(PlainXmlWriter xml, TraceEventType type, TraceCode code, string description, TraceRecord trace, Exception exception, object source)
 {
     xml.WriteStartElement("TraceRecord");
     xml.WriteAttributeString("xmlns", "http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord");
     xml.WriteAttributeString("Severity", Microsoft.ServiceBus.Diagnostics.DiagnosticTrace.LookupSeverity(type));
     xml.WriteElementString("TraceIdentifier", Microsoft.ServiceBus.Diagnostics.DiagnosticTrace.GenerateTraceCode(code));
     xml.WriteElementString("Description", description);
     xml.WriteElementString("AppDomain", this.AppDomainFriendlyName);
     if (source != null)
     {
         xml.WriteElementString("Source", Microsoft.ServiceBus.Diagnostics.DiagnosticTrace.CreateSourceString(source));
     }
     if (trace != null)
     {
         xml.WriteStartElement("ExtendedData");
         xml.WriteAttributeString("xmlns", trace.EventId);
         trace.WriteTo(xml);
         xml.WriteEndElement();
     }
     if (exception != null)
     {
         xml.WriteStartElement("Exception");
         this.AddExceptionToTraceString(xml, exception);
         xml.WriteEndElement();
     }
     xml.WriteEndElement();
 }
Example #2
0
        public override void WriteString(string text)
        {
            if (!this.writingAttribute)
            {
                this.WriteValue(text);
                return;
            }
            PlainXmlWriter plainXmlWriter = this;

            plainXmlWriter.currentAttributeText = string.Concat(plainXmlWriter.currentAttributeText, text);
        }
        private void BuildTrace(TraceEventType type, TraceCode code, string description, TraceRecord trace, Exception exception, object source, out TraceXPathNavigator navigator)
        {
            PlainXmlWriter plainXmlWriter = new PlainXmlWriter(65535);

            navigator = plainXmlWriter.Navigator;
            this.BuildTrace(plainXmlWriter, type, code, description, trace, exception, source);
            if (!this.TraceSource.ShouldLogPii)
            {
                navigator.RemovePii(Microsoft.ServiceBus.Diagnostics.DiagnosticStrings.HeadersPaths);
            }
        }