Exception needs to be a string as Serilog cant easily convert JSON serialised EX back to proper exceptions so we call ToString on it instead

This commit is contained in:
Warren
2018-08-30 16:24:34 +01:00
parent 04f7b14702
commit c3fa12be6e
2 changed files with 3 additions and 3 deletions

View File

@@ -58,7 +58,7 @@ namespace Umbraco.Core.Logging.Viewer
public int GetNumberOfErrors(DateTimeOffset startDate, DateTimeOffset endDate)
{
var logs = GetAllLogs(startDate, endDate);
return logs.Count(x => x.Level == LogEventLevel.Fatal && x.Level == LogEventLevel.Error && x.Exception != null);
return logs.Count(x => x.Level == LogEventLevel.Fatal || x.Level == LogEventLevel.Error || x.Exception != null);
}
public LogLevelCounts GetLogLevelCounts(DateTimeOffset startDate, DateTimeOffset endDate)
@@ -115,7 +115,7 @@ namespace Umbraco.Core.Logging.Viewer
Timestamp = x.Timestamp,
Level = x.Level,
MessageTemplateText = x.MessageTemplate.Text,
Exception = x.Exception,
Exception = x.Exception?.ToString(),
Properties = x.Properties,
RenderedMessage = x.RenderMessage()
});

View File

@@ -37,6 +37,6 @@ namespace Umbraco.Core.Logging.Viewer
/// <summary>
/// An exception associated with the logevent, or null.
/// </summary>
public Exception Exception { get; set; }
public string Exception { get; set; }
}
}