|
4 | 4 | using Exceptionless.Enrichments;
|
5 | 5 | using Exceptionless.Models;
|
6 | 6 | using NLog;
|
7 |
| -using NLog.Fluent; |
8 | 7 |
|
9 | 8 | namespace Exceptionless.NLog {
|
10 | 9 | public static class ExceptionlessClientExtensions {
|
@@ -42,64 +41,6 @@ public static void SubmitFromLogEvent(this ExceptionlessClient client, LogEventI
|
42 | 41 | CreateFromLogEvent(client, ev).Submit();
|
43 | 42 | }
|
44 | 43 |
|
45 |
| - public static LogBuilder Tag(this LogBuilder builder, params string[] tags) { |
46 |
| - var tagList = builder.LogEventInfo.GetTags(); |
47 |
| - tagList.AddRange(tags); |
48 |
| - |
49 |
| - return builder; |
50 |
| - } |
51 |
| - |
52 |
| - public static LogBuilder ContextProperty(this LogBuilder builder, string key, object value) { |
53 |
| - var contextData = builder.LogEventInfo.GetContextData(); |
54 |
| - contextData[key] = value; |
55 |
| - |
56 |
| - return builder; |
57 |
| - } |
58 |
| - |
59 |
| - public static LogBuilder MarkUnhandled(this LogBuilder builder, string submissionMethod = null) { |
60 |
| - var contextData = builder.LogEventInfo.GetContextData(); |
61 |
| - contextData.MarkAsUnhandledError(); |
62 |
| - if (!String.IsNullOrEmpty(submissionMethod)) |
63 |
| - contextData.SetSubmissionMethod(submissionMethod); |
64 |
| - |
65 |
| - return builder; |
66 |
| - } |
67 |
| - |
68 |
| - public static void MarkAsUnhandledError(this IDictionary<string, object> contextData) { |
69 |
| - contextData[IsUnhandledError] = true; |
70 |
| - } |
71 |
| - |
72 |
| - public static void SetSubmissionMethod(this IDictionary<string, object> contextData, string submissionMethod) { |
73 |
| - contextData[SubmissionMethod] = submissionMethod; |
74 |
| - } |
75 |
| - |
76 |
| - public const string IsUnhandledError = "@@_IsUnhandledError"; |
77 |
| - public const string SubmissionMethod = "@@_SubmissionMethod"; |
78 |
| - |
79 |
| - public static List<string> GetTags(this LogEventInfo ev) { |
80 |
| - var tagList = new List<string>(); |
81 |
| - if (!ev.Properties.ContainsKey("Tags")) |
82 |
| - ev.Properties["Tags"] = tagList; |
83 |
| - |
84 |
| - if (ev.Properties.ContainsKey("Tags") |
85 |
| - && ev.Properties["Tags"] is List<string>) |
86 |
| - tagList = (List<string>)ev.Properties["Tags"]; |
87 |
| - |
88 |
| - return tagList; |
89 |
| - } |
90 |
| - |
91 |
| - public static IDictionary<string, object> GetContextData(this LogEventInfo ev) { |
92 |
| - IDictionary<string, object> contextData = new Dictionary<string, object>(); |
93 |
| - if (!ev.Properties.ContainsKey("ContextData")) |
94 |
| - ev.Properties["ContextData"] = contextData; |
95 |
| - |
96 |
| - if (ev.Properties.ContainsKey("ContextData") |
97 |
| - && ev.Properties["ContextData"] is IDictionary<string, object>) |
98 |
| - contextData = (IDictionary<string, object>)ev.Properties["ContextData"]; |
99 |
| - |
100 |
| - return contextData; |
101 |
| - } |
102 |
| - |
103 | 44 | private static readonly List<string> _ignoredEventProperties = new List<string> {
|
104 | 45 | "CallerFilePath",
|
105 | 46 | "CallerMemberName",
|
|
0 commit comments