From 0810dc3cafc8cb382f6da492ca40120e3dcc9797 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 23 Feb 2016 11:21:31 -0600 Subject: [PATCH 1/6] Added new stacking info --- .../Exceptionless.SampleConsole.csproj | 8 ++-- Source/Samples/SampleConsole/packages.config | 4 +- Source/Shared/Exceptionless.Portable.csproj | 1 + .../Extensions/EventBuilderExtensions.cs | 33 +++++++++++++++ Source/Shared/Extensions/EventExtensions.cs | 42 ++++++++++++++++++- .../Shared/Models/Client/Data/StackingInfo.cs | 33 +++++++++++++++ Source/Tests/Exceptionless.Tests.csproj | 8 ++-- Source/Tests/packages.config | 4 +- appveyor.yml | 2 +- 9 files changed, 120 insertions(+), 15 deletions(-) create mode 100644 Source/Shared/Models/Client/Data/StackingInfo.cs diff --git a/Source/Samples/SampleConsole/Exceptionless.SampleConsole.csproj b/Source/Samples/SampleConsole/Exceptionless.SampleConsole.csproj index 655f3bc0..9a073b7d 100644 --- a/Source/Samples/SampleConsole/Exceptionless.SampleConsole.csproj +++ b/Source/Samples/SampleConsole/Exceptionless.SampleConsole.csproj @@ -44,12 +44,12 @@ - - ..\..\..\packages\Exceptionless.DateTimeExtensions.3.1.42\lib\portable-net40+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\Exceptionless.DateTimeExtensions.dll + + ..\..\..\packages\Exceptionless.DateTimeExtensions.3.1.44\lib\portable-net40+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\Exceptionless.DateTimeExtensions.dll True - - ..\..\..\packages\Exceptionless.RandomData.1.0.17.0\lib\net40\Exceptionless.RandomData.dll + + ..\..\..\packages\Exceptionless.RandomData.1.0.21.0\lib\net40\Exceptionless.RandomData.dll True diff --git a/Source/Samples/SampleConsole/packages.config b/Source/Samples/SampleConsole/packages.config index 8509973e..6beb1abb 100644 --- a/Source/Samples/SampleConsole/packages.config +++ b/Source/Samples/SampleConsole/packages.config @@ -1,7 +1,7 @@  - - + + diff --git a/Source/Shared/Exceptionless.Portable.csproj b/Source/Shared/Exceptionless.Portable.csproj index 7675e545..3d6aec25 100644 --- a/Source/Shared/Exceptionless.Portable.csproj +++ b/Source/Shared/Exceptionless.Portable.csproj @@ -60,6 +60,7 @@ + diff --git a/Source/Shared/Extensions/EventBuilderExtensions.cs b/Source/Shared/Extensions/EventBuilderExtensions.cs index 740ae9f9..a28c7b08 100644 --- a/Source/Shared/Extensions/EventBuilderExtensions.cs +++ b/Source/Shared/Extensions/EventBuilderExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Exceptionless.Models.Data; namespace Exceptionless { @@ -55,6 +56,27 @@ public static EventBuilder SetVersion(this EventBuilder builder, string version) return builder; } + /// + /// Changes default stacking behavior by setting the stacking key. + /// + /// The event builder object. + /// Key value pair that determines how the event is stacked. + public static EventBuilder SetManualStackingInfo(this EventBuilder builder, IDictionary signatureData) { + builder.Target.SetManualStackingInfo(signatureData); + return builder; + } + + /// + /// Changes default stacking behavior by setting the stacking key. + /// + /// The event builder object. + /// The stack title. + /// Key value pair that determines how the event is stacked. + public static EventBuilder SetManualStackingInfo(this EventBuilder builder, string title, IDictionary signatureData) { + builder.Target.SetManualStackingInfo(title, signatureData); + return builder; + } + /// /// Changes default stacking behavior by setting the stacking key. /// @@ -64,5 +86,16 @@ public static EventBuilder SetManualStackingKey(this EventBuilder builder, strin builder.Target.SetManualStackingKey(manualStackingKey); return builder; } + + /// + /// Changes default stacking behavior by setting the stacking key. + /// + /// The event builder object. + /// The stack title. + /// The manual stacking key. + public static EventBuilder SetManualStackingKey(this EventBuilder builder, string title, string manualStackingKey) { + builder.Target.SetManualStackingKey(title, manualStackingKey); + return builder; + } } } \ No newline at end of file diff --git a/Source/Shared/Extensions/EventExtensions.cs b/Source/Shared/Extensions/EventExtensions.cs index f2afb53e..ceb03b39 100644 --- a/Source/Shared/Extensions/EventExtensions.cs +++ b/Source/Shared/Extensions/EventExtensions.cs @@ -281,7 +281,32 @@ private static bool IsValidIdentifier(string value) { } /// - /// Sets the manual stacking key + /// Changes default stacking behavior + /// + /// The event + /// Key value pair that determines how the event is stacked. + public static void SetManualStackingInfo(this Event ev, IDictionary signatureData) { + if (signatureData == null || signatureData.Count == 0) + return; + + ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(signatureData); + } + + /// + /// Changes default stacking behavior + /// + /// The event + /// The stack title. + /// Key value pair that determines how the event is stacked. + public static void SetManualStackingInfo(this Event ev, string title, IDictionary signatureData) { + if (String.IsNullOrWhiteSpace(title) || signatureData == null || signatureData.Count == 0) + return; + + ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(title, signatureData); + } + + /// + /// Changes default stacking behavior by setting the stacking info. /// /// The event /// The manual stacking key. @@ -289,7 +314,20 @@ public static void SetManualStackingKey(this Event ev, string manualStackingKey) if (String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.ManualStackingKey] = manualStackingKey.Trim(); + ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(null, new Dictionary { { String.Empty, manualStackingKey } }); + } + + /// + /// Changes default stacking behavior by setting the stacking info. + /// + /// The event + /// The stack title. + /// The manual stacking key. + public static void SetManualStackingKey(this Event ev, string title, string manualStackingKey) { + if (String.IsNullOrWhiteSpace(title) || String.IsNullOrWhiteSpace(manualStackingKey)) + return; + + ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(title, new Dictionary { { String.Empty, manualStackingKey } }); } public static T GetDataValue(this Event ev, string key, IJsonSerializer serializer = null) { diff --git a/Source/Shared/Models/Client/Data/StackingInfo.cs b/Source/Shared/Models/Client/Data/StackingInfo.cs new file mode 100644 index 00000000..c112d149 --- /dev/null +++ b/Source/Shared/Models/Client/Data/StackingInfo.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Exceptionless.Extensions; + +namespace Exceptionless.Models.Data { + public class StackingInfo { + public StackingInfo() { + SignatureData = new Dictionary(); + } + + public StackingInfo(string title) : this() { + if (!String.IsNullOrWhiteSpace(title)) + Title = title.Trim(); + } + + public StackingInfo(string title, IDictionary signatureData) : this(title) { + if (signatureData != null && signatureData.Count > 0) + SignatureData.AddRange(signatureData); + } + + public StackingInfo(IDictionary signatureData) : this(null, signatureData) {} + + /// + /// Stack Title (defaults to the event message) + /// + public string Title { get; set; } + + /// + /// Key value pair that determines how the event is stacked. + /// + public IDictionary SignatureData { get; set; } + } +} \ No newline at end of file diff --git a/Source/Tests/Exceptionless.Tests.csproj b/Source/Tests/Exceptionless.Tests.csproj index 5a24a299..9526e2a7 100644 --- a/Source/Tests/Exceptionless.Tests.csproj +++ b/Source/Tests/Exceptionless.Tests.csproj @@ -38,12 +38,12 @@ false - - ..\..\packages\Exceptionless.RandomData.1.0.17.0\lib\net40\Exceptionless.RandomData.dll + + ..\..\packages\Exceptionless.RandomData.1.0.21.0\lib\net40\Exceptionless.RandomData.dll True - - ..\..\packages\Foundatio.3.0.629\lib\net45\Foundatio.dll + + ..\..\packages\Foundatio.4.0.672\lib\net45\Foundatio.dll True diff --git a/Source/Tests/packages.config b/Source/Tests/packages.config index e749d82c..162fbee4 100644 --- a/Source/Tests/packages.config +++ b/Source/Tests/packages.config @@ -1,7 +1,7 @@  - - + + diff --git a/appveyor.yml b/appveyor.yml index eb35341d..0fd345c3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.3.{build} +version: 3.4.{build} clone_depth: 2 configuration: Release From 9b610820f8cc06645c3edf52d2098a3fae485be8 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 23 Feb 2016 11:23:25 -0600 Subject: [PATCH 2/6] Updated the manual stacking key name --- Source/Shared/Extensions/EventExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Shared/Extensions/EventExtensions.cs b/Source/Shared/Extensions/EventExtensions.cs index ceb03b39..5db076cd 100644 --- a/Source/Shared/Extensions/EventExtensions.cs +++ b/Source/Shared/Extensions/EventExtensions.cs @@ -314,7 +314,7 @@ public static void SetManualStackingKey(this Event ev, string manualStackingKey) if (String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(null, new Dictionary { { String.Empty, manualStackingKey } }); + ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(null, new Dictionary { { "ManualStackingKey", manualStackingKey } }); } /// @@ -327,7 +327,7 @@ public static void SetManualStackingKey(this Event ev, string title, string manu if (String.IsNullOrWhiteSpace(title) || String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(title, new Dictionary { { String.Empty, manualStackingKey } }); + ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(title, new Dictionary { { "ManualStackingKey", manualStackingKey } }); } public static T GetDataValue(this Event ev, string key, IJsonSerializer serializer = null) { From 9e42f8024b8b34fcd3470614a9ff9f4398131458 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 23 Feb 2016 11:24:10 -0600 Subject: [PATCH 3/6] Changed the version --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0fd345c3..eb35341d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.4.{build} +version: 3.3.{build} clone_depth: 2 configuration: Release From 276e9ee0d001a90354fc832c61a53dffaa9a9015 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 23 Feb 2016 11:50:23 -0600 Subject: [PATCH 4/6] Changed the name of the known data key. --- Source/Shared/Extensions/EventExtensions.cs | 8 ++++---- Source/Shared/Models/Client/Event.cs | 2 +- Source/Tests/Plugins/PluginTests.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Shared/Extensions/EventExtensions.cs b/Source/Shared/Extensions/EventExtensions.cs index 5db076cd..9408a39a 100644 --- a/Source/Shared/Extensions/EventExtensions.cs +++ b/Source/Shared/Extensions/EventExtensions.cs @@ -289,7 +289,7 @@ public static void SetManualStackingInfo(this Event ev, IDictionary @@ -302,7 +302,7 @@ public static void SetManualStackingInfo(this Event ev, string title, IDictionar if (String.IsNullOrWhiteSpace(title) || signatureData == null || signatureData.Count == 0) return; - ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(title, signatureData); + ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(title, signatureData); } /// @@ -314,7 +314,7 @@ public static void SetManualStackingKey(this Event ev, string manualStackingKey) if (String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(null, new Dictionary { { "ManualStackingKey", manualStackingKey } }); + ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(null, new Dictionary { { "ManualStackingKey", manualStackingKey } }); } /// @@ -327,7 +327,7 @@ public static void SetManualStackingKey(this Event ev, string title, string manu if (String.IsNullOrWhiteSpace(title) || String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.ManualStackingKey] = new StackingInfo(title, new Dictionary { { "ManualStackingKey", manualStackingKey } }); + ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(title, new Dictionary { { "ManualStackingKey", manualStackingKey } }); } public static T GetDataValue(this Event ev, string key, IJsonSerializer serializer = null) { diff --git a/Source/Shared/Models/Client/Event.cs b/Source/Shared/Models/Client/Event.cs index 0219b9aa..7d56b0b0 100644 --- a/Source/Shared/Models/Client/Event.cs +++ b/Source/Shared/Models/Client/Event.cs @@ -78,7 +78,7 @@ public static class KnownDataKeys { public const string Version = "@version"; public const string Level = "@level"; public const string SubmissionMethod = "@submission_method"; - public const string ManualStackingKey = "@stack"; + public const string StackingInfo = "@stack"; } } } \ No newline at end of file diff --git a/Source/Tests/Plugins/PluginTests.cs b/Source/Tests/Plugins/PluginTests.cs index da9e7e71..a05edd94 100644 --- a/Source/Tests/Plugins/PluginTests.cs +++ b/Source/Tests/Plugins/PluginTests.cs @@ -66,7 +66,7 @@ public void ConfigurationDefaults_SerializedProperties() { client.Configuration.DefaultData.Add(Event.KnownDataKeys.EnvironmentInfo, new EnvironmentInfo { MachineName = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.Error, new Error { Message = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.Level, "Debug"); - client.Configuration.DefaultData.Add(Event.KnownDataKeys.ManualStackingKey, "blake"); + client.Configuration.DefaultData.Add(Event.KnownDataKeys.StackingInfo, "blake"); client.Configuration.DefaultData.Add(Event.KnownDataKeys.RequestInfo, new RequestInfo { Host = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.SimpleError, new SimpleError { Message = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.SubmissionMethod, "test"); @@ -87,7 +87,7 @@ public void ConfigurationDefaults_SerializedProperties() { Assert.Equal("blake", context.Event.GetError().Message); Assert.Equal("blake", context.Event.GetError(serializer).Message); Assert.Equal("Debug", context.Event.Data[Event.KnownDataKeys.Level]); - Assert.Equal("blake", context.Event.Data[Event.KnownDataKeys.ManualStackingKey]); + Assert.Equal("blake", context.Event.Data[Event.KnownDataKeys.StackingInfo]); Assert.True(context.Event.Data[Event.KnownDataKeys.RequestInfo] is string); Assert.Equal("blake", context.Event.GetRequestInfo().Host); Assert.Equal("blake", context.Event.GetRequestInfo(serializer).Host); From 64a67a6d126bea62539caa0ed1aa695d627b3348 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 23 Feb 2016 18:51:29 -0600 Subject: [PATCH 5/6] Renamed StackingInfo to ManualStackingInfo --- .../SampleMvc/Controllers/HomeController.cs | 18 ++++++++++++++++++ .../SampleMvc/Controllers/ValuesController.cs | 7 ++++++- .../Samples/SampleMvc/Views/Home/Index.cshtml | 1 + Source/Shared/Exceptionless.Portable.csproj | 2 +- Source/Shared/Extensions/EventExtensions.cs | 8 ++++---- .../{StackingInfo.cs => ManualStackingInfo.cs} | 10 +++++----- Source/Shared/Models/Client/Event.cs | 2 +- Source/Tests/Plugins/PluginTests.cs | 4 ++-- 8 files changed, 38 insertions(+), 14 deletions(-) rename Source/Shared/Models/Client/Data/{StackingInfo.cs => ManualStackingInfo.cs} (68%) diff --git a/Source/Samples/SampleMvc/Controllers/HomeController.cs b/Source/Samples/SampleMvc/Controllers/HomeController.cs index b5a7b77f..9ade051f 100644 --- a/Source/Samples/SampleMvc/Controllers/HomeController.cs +++ b/Source/Samples/SampleMvc/Controllers/HomeController.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading; using System.Web; using System.Web.Mvc; @@ -32,6 +33,23 @@ public ViewResult Error() { public ViewResult CustomError() { return View("CustomError"); } + + [HttpGet] + public ViewResult ManualStacking() { + ExceptionlessClient.Default.CreateLog(nameof(HomeController), "Random Log message") + .SetManualStackingInfo("Manual Stacked Log Messages", new Dictionary { + { "Controller", nameof(HomeController) }, + { "Action", nameof(ManualStacking) } + }) + .Submit(); + + try { + throw new Exception(Guid.NewGuid().ToString()); + } catch (Exception ex) { + ex.ToExceptionless().SetManualStackingKey(nameof(HomeController)).Submit(); + throw; + } + } [HttpGet] public ViewResult FourZeroFour() { diff --git a/Source/Samples/SampleMvc/Controllers/ValuesController.cs b/Source/Samples/SampleMvc/Controllers/ValuesController.cs index 8721646b..2c5dcd6b 100644 --- a/Source/Samples/SampleMvc/Controllers/ValuesController.cs +++ b/Source/Samples/SampleMvc/Controllers/ValuesController.cs @@ -6,7 +6,12 @@ namespace Exceptionless.SampleMvc.Controllers { public class ValuesController : ApiController { // GET api/values public IEnumerable Get() { - throw new ApplicationException("WebApi GET error"); + try { + throw new ApplicationException("WebApi GET error"); + } catch (Exception ex) { + ex.ToExceptionless().Submit(); + throw; + } } // GET api/values/5 diff --git a/Source/Samples/SampleMvc/Views/Home/Index.cshtml b/Source/Samples/SampleMvc/Views/Home/Index.cshtml index 03a583e8..eee891f5 100644 --- a/Source/Samples/SampleMvc/Views/Home/Index.cshtml +++ b/Source/Samples/SampleMvc/Views/Home/Index.cshtml @@ -3,6 +3,7 @@ @Html.ActionLink("Boom!", "Boom") @Html.ActionLink("Custom Boom!", "CustomBoom") @Html.ActionLink("Boom 25!", "Boom25") +@Html.ActionLink("Manual Stacking", "ManualStacking") Ajax Boom diff --git a/Source/Shared/Exceptionless.Portable.csproj b/Source/Shared/Exceptionless.Portable.csproj index 3d6aec25..0ebbe07c 100644 --- a/Source/Shared/Exceptionless.Portable.csproj +++ b/Source/Shared/Exceptionless.Portable.csproj @@ -60,7 +60,7 @@ - + diff --git a/Source/Shared/Extensions/EventExtensions.cs b/Source/Shared/Extensions/EventExtensions.cs index 9408a39a..71f30c96 100644 --- a/Source/Shared/Extensions/EventExtensions.cs +++ b/Source/Shared/Extensions/EventExtensions.cs @@ -289,7 +289,7 @@ public static void SetManualStackingInfo(this Event ev, IDictionary @@ -302,7 +302,7 @@ public static void SetManualStackingInfo(this Event ev, string title, IDictionar if (String.IsNullOrWhiteSpace(title) || signatureData == null || signatureData.Count == 0) return; - ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(title, signatureData); + ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(title, signatureData); } /// @@ -314,7 +314,7 @@ public static void SetManualStackingKey(this Event ev, string manualStackingKey) if (String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(null, new Dictionary { { "ManualStackingKey", manualStackingKey } }); + ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(null, new Dictionary { { "ManualStackingKey", manualStackingKey } }); } /// @@ -327,7 +327,7 @@ public static void SetManualStackingKey(this Event ev, string title, string manu if (String.IsNullOrWhiteSpace(title) || String.IsNullOrWhiteSpace(manualStackingKey)) return; - ev.Data[Event.KnownDataKeys.StackingInfo] = new StackingInfo(title, new Dictionary { { "ManualStackingKey", manualStackingKey } }); + ev.Data[Event.KnownDataKeys.ManualStackingInfo] = new ManualStackingInfo(title, new Dictionary { { "ManualStackingKey", manualStackingKey } }); } public static T GetDataValue(this Event ev, string key, IJsonSerializer serializer = null) { diff --git a/Source/Shared/Models/Client/Data/StackingInfo.cs b/Source/Shared/Models/Client/Data/ManualStackingInfo.cs similarity index 68% rename from Source/Shared/Models/Client/Data/StackingInfo.cs rename to Source/Shared/Models/Client/Data/ManualStackingInfo.cs index c112d149..84f99577 100644 --- a/Source/Shared/Models/Client/Data/StackingInfo.cs +++ b/Source/Shared/Models/Client/Data/ManualStackingInfo.cs @@ -3,22 +3,22 @@ using Exceptionless.Extensions; namespace Exceptionless.Models.Data { - public class StackingInfo { - public StackingInfo() { + public class ManualStackingInfo { + public ManualStackingInfo() { SignatureData = new Dictionary(); } - public StackingInfo(string title) : this() { + public ManualStackingInfo(string title) : this() { if (!String.IsNullOrWhiteSpace(title)) Title = title.Trim(); } - public StackingInfo(string title, IDictionary signatureData) : this(title) { + public ManualStackingInfo(string title, IDictionary signatureData) : this(title) { if (signatureData != null && signatureData.Count > 0) SignatureData.AddRange(signatureData); } - public StackingInfo(IDictionary signatureData) : this(null, signatureData) {} + public ManualStackingInfo(IDictionary signatureData) : this(null, signatureData) {} /// /// Stack Title (defaults to the event message) diff --git a/Source/Shared/Models/Client/Event.cs b/Source/Shared/Models/Client/Event.cs index 7d56b0b0..3da8a65d 100644 --- a/Source/Shared/Models/Client/Event.cs +++ b/Source/Shared/Models/Client/Event.cs @@ -78,7 +78,7 @@ public static class KnownDataKeys { public const string Version = "@version"; public const string Level = "@level"; public const string SubmissionMethod = "@submission_method"; - public const string StackingInfo = "@stack"; + public const string ManualStackingInfo = "@stack"; } } } \ No newline at end of file diff --git a/Source/Tests/Plugins/PluginTests.cs b/Source/Tests/Plugins/PluginTests.cs index a05edd94..4c3df0f2 100644 --- a/Source/Tests/Plugins/PluginTests.cs +++ b/Source/Tests/Plugins/PluginTests.cs @@ -66,7 +66,7 @@ public void ConfigurationDefaults_SerializedProperties() { client.Configuration.DefaultData.Add(Event.KnownDataKeys.EnvironmentInfo, new EnvironmentInfo { MachineName = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.Error, new Error { Message = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.Level, "Debug"); - client.Configuration.DefaultData.Add(Event.KnownDataKeys.StackingInfo, "blake"); + client.Configuration.DefaultData.Add(Event.KnownDataKeys.ManualStackingInfo, "blake"); client.Configuration.DefaultData.Add(Event.KnownDataKeys.RequestInfo, new RequestInfo { Host = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.SimpleError, new SimpleError { Message = "blake" }); client.Configuration.DefaultData.Add(Event.KnownDataKeys.SubmissionMethod, "test"); @@ -87,7 +87,7 @@ public void ConfigurationDefaults_SerializedProperties() { Assert.Equal("blake", context.Event.GetError().Message); Assert.Equal("blake", context.Event.GetError(serializer).Message); Assert.Equal("Debug", context.Event.Data[Event.KnownDataKeys.Level]); - Assert.Equal("blake", context.Event.Data[Event.KnownDataKeys.StackingInfo]); + Assert.Equal("blake", context.Event.Data[Event.KnownDataKeys.ManualStackingInfo]); Assert.True(context.Event.Data[Event.KnownDataKeys.RequestInfo] is string); Assert.Equal("blake", context.Event.GetRequestInfo().Host); Assert.Equal("blake", context.Event.GetRequestInfo(serializer).Host); From 4df268f325f66a5960f2235d0f63385db4246742 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Tue, 23 Feb 2016 21:53:45 -0600 Subject: [PATCH 6/6] Fixed #63 Fixed an issue where dictionary keys names were being changed. https://github.com/exceptionless/Exceptionless.Net/issues/63 --- Source/Samples/SampleMvc/Controllers/HomeController.cs | 2 +- Source/Samples/SampleMvc/Views/Home/Index.cshtml | 2 +- Source/Shared/Serializer/ExceptionlessContractResolver.cs | 4 ---- Source/Tests/Plugins/PluginTests.cs | 3 +-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Source/Samples/SampleMvc/Controllers/HomeController.cs b/Source/Samples/SampleMvc/Controllers/HomeController.cs index 9ade051f..22634dd8 100644 --- a/Source/Samples/SampleMvc/Controllers/HomeController.cs +++ b/Source/Samples/SampleMvc/Controllers/HomeController.cs @@ -35,7 +35,7 @@ public ViewResult CustomError() { } [HttpGet] - public ViewResult ManualStacking() { + public ViewResult ManualStacking(string myId) { ExceptionlessClient.Default.CreateLog(nameof(HomeController), "Random Log message") .SetManualStackingInfo("Manual Stacked Log Messages", new Dictionary { { "Controller", nameof(HomeController) }, diff --git a/Source/Samples/SampleMvc/Views/Home/Index.cshtml b/Source/Samples/SampleMvc/Views/Home/Index.cshtml index eee891f5..b9ad429c 100644 --- a/Source/Samples/SampleMvc/Views/Home/Index.cshtml +++ b/Source/Samples/SampleMvc/Views/Home/Index.cshtml @@ -3,7 +3,7 @@ @Html.ActionLink("Boom!", "Boom") @Html.ActionLink("Custom Boom!", "CustomBoom") @Html.ActionLink("Boom 25!", "Boom25") -@Html.ActionLink("Manual Stacking", "ManualStacking") +@Html.ActionLink("Manual Stacking", "ManualStacking", new { myId = "123456789" }) Ajax Boom diff --git a/Source/Shared/Serializer/ExceptionlessContractResolver.cs b/Source/Shared/Serializer/ExceptionlessContractResolver.cs index e403e0d2..61a3cfee 100644 --- a/Source/Shared/Serializer/ExceptionlessContractResolver.cs +++ b/Source/Shared/Serializer/ExceptionlessContractResolver.cs @@ -1,6 +1,5 @@ using System; using System.Reflection; -using Exceptionless.Models; using Exceptionless.Json; using Exceptionless.Json.Serialization; using Exceptionless.Extensions; @@ -24,9 +23,6 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ } protected override JsonDictionaryContract CreateDictionaryContract(Type objectType) { - if (objectType != typeof(DataDictionary) && objectType != typeof(SettingsDictionary)) - return base.CreateDictionaryContract(objectType); - JsonDictionaryContract contract = base.CreateDictionaryContract(objectType); contract.PropertyNameResolver = propertyName => propertyName; return contract; diff --git a/Source/Tests/Plugins/PluginTests.cs b/Source/Tests/Plugins/PluginTests.cs index 4c3df0f2..74462f31 100644 --- a/Source/Tests/Plugins/PluginTests.cs +++ b/Source/Tests/Plugins/PluginTests.cs @@ -153,8 +153,7 @@ public void HandleAggregateExceptionsPlugin_SingleInnerException() { context = new EventPluginContext(client, new Event()); context.ContextData.SetException(new AggregateException(exceptionOne, exceptionTwo)); plugin.Run(context); - Assert.False(context.Cancel); - Assert.Equal(exceptionOne, context.ContextData.GetException()); + Assert.True(context.Cancel); } [Fact]