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:
@@ -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()
|
||||
});
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user