示例#1
0
        public string GetEntryMessage(AzureDiagnosticLogEntry entry)
        {
            var infraLogEntry = (WADDiagnosticInfrastructureLogsTableEntry)entry;
            var builder       = new StringBuilder();

            builder.AppendFormat("{0}\n  RoleInstance={1}\n  DeploymentId={2}", infraLogEntry.Message,
                                 entry.RoleInstance ?? "", entry.DeploymentId ?? "");
            if (!string.IsNullOrEmpty(infraLogEntry.Function) || infraLogEntry.Line != 0 || infraLogEntry.MDRESULT != 0)
            {
                builder.AppendFormat("\n  Function={0}:{1}", infraLogEntry.Function ?? "<unknown>", infraLogEntry.Line.ToString());
                if (infraLogEntry.MDRESULT != 0)
                {
                    builder.AppendFormat(" -> {0}", infraLogEntry.MDRESULT);
                }
            }
            if (!string.IsNullOrEmpty(infraLogEntry.ErrorCodeMsg) || infraLogEntry.ErrorCode != 0)
            {
                builder.AppendFormat("\n  Error={0}", infraLogEntry.ErrorCode);
                if (!string.IsNullOrEmpty(infraLogEntry.ErrorCodeMsg))
                {
                    builder.AppendFormat("({0})", infraLogEntry.ErrorCodeMsg);
                }
            }
            return(builder.ToString());
        }
示例#2
0
        public string GetEntryMessage(AzureDiagnosticLogEntry entry)
        {
            var eventLogEntry = (WADWindowsEventLogsTableEntry)entry;

            return(string.Format("{0}\n  RoleInstance={1}\n  DeploymentId={2}\n  Channel={3}", eventLogEntry.Description,
                                 entry.RoleInstance ?? "", entry.DeploymentId ?? "", eventLogEntry.Channel ?? ""));
        }
示例#3
0
        void WriteEntry(AzureDiagnosticLogEntry entry, LiveLogXMLWriter output)
        {
            XmlWriter writer = output.BeginWriteMessage(false);

            writer.WriteStartElement("m");
            writer.WriteAttributeString("d", Listener.FormatDate(new DateTime(entry.EventTickCount, DateTimeKind.Utc).ToLocalTime()));
            writer.WriteAttributeString("t", string.Format("{0}-{1}", entry.Pid, entry.Tid));
            if (entry.Level <= 2)
            {
                writer.WriteAttributeString("s", "e");
            }
            else if (entry.Level == 3)
            {
                writer.WriteAttributeString("s", "w");
            }
            writer.WriteString(strategy.GetEntryMessage(entry));
            writer.WriteEndElement();
            output.EndWriteMessage();
        }
示例#4
0
        public string GetEntryMessage(AzureDiagnosticLogEntry entry)
        {
            var wadLogsTableEntry = (WADLogsTableEntry)entry;

            return(string.Format("{0}\n  RoleInstance={1}\n  DeploymentId={2}", wadLogsTableEntry.Message, entry.RoleInstance ?? "", entry.DeploymentId ?? ""));
        }
示例#5
0
 public IndexedAzureDiagnosticLogEntry(AzureDiagnosticLogEntry entry, int indexWithinPartition)
 {
     Entry = entry;
     IndexWithinPartition = indexWithinPartition;
 }