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()); }
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 ?? "")); }
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(); }
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 ?? "")); }
public IndexedAzureDiagnosticLogEntry(AzureDiagnosticLogEntry entry, int indexWithinPartition) { Entry = entry; IndexWithinPartition = indexWithinPartition; }