From 922da5596d883a1b26acf47f312f6cbf5d80e2a2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 29 Mar 2018 23:46:27 -0400 Subject: [PATCH] add current time and props to logs --- src/Admin/Models/LogModel.cs | 2 ++ src/Admin/Views/Logs/Index.cshtml | 2 ++ src/Admin/Views/Logs/View.cshtml | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/src/Admin/Models/LogModel.cs b/src/Admin/Models/LogModel.cs index 0b101eb617..744f0e8767 100644 --- a/src/Admin/Models/LogModel.cs +++ b/src/Admin/Models/LogModel.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Runtime.Serialization; using Microsoft.Azure.Documents; using Newtonsoft.Json; @@ -14,6 +15,7 @@ namespace Bit.Admin.Models public string MessageTruncated => Message.Length > 200 ? $"{Message.Substring(0, 200)}..." : Message; public string MessageTemplate { get; set; } public Error Exception { get; set; } + public IDictionary Properties { get; set; } [JsonObject(MemberSerialization.OptIn)] public class Error : Exception, ISerializable diff --git a/src/Admin/Views/Logs/Index.cshtml b/src/Admin/Views/Logs/Index.cshtml index 4210f1ecd6..6cb18d9762 100644 --- a/src/Admin/Views/Logs/Index.cshtml +++ b/src/Admin/Views/Logs/Index.cshtml @@ -5,6 +5,8 @@

Logs

+

Current UTC time: @DateTime.UtcNow.ToString()

+
diff --git a/src/Admin/Views/Logs/View.cshtml b/src/Admin/Views/Logs/View.cshtml index 9358e913b2..151639a07a 100644 --- a/src/Admin/Views/Logs/View.cshtml +++ b/src/Admin/Views/Logs/View.cshtml @@ -28,3 +28,15 @@

Exception

@Model.Exception.ToString()
} + +@if(Model.Properties != null && Model.Properties.Count > 0) +{ +

Properties

+
+ @foreach(var prop in Model.Properties) + { +
@prop.Key
+
@(prop.Value?.ToString() ?? "-")
+ } +
+}