Skip to content

Commit 7a8ccfb

Browse files
Fixed serialization problems after restore newtonsoft.json (#86)
* Update LogLine attributes * Updated usings in LogLine
1 parent a5fa6a6 commit 7a8ccfb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Nlog.RabbitMQ.Target/LogLine.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
using System.Collections.Generic;
2-
using System.Text.Json.Serialization;
1+
using System;
2+
using System.Collections.Generic;
3+
using Newtonsoft.Json;
34

45
namespace Nlog.RabbitMQ.Target
56
{
67
public class LogLine
78
{
8-
[JsonPropertyName("@source")]
9+
[JsonProperty("@source")]
910
public string Source { get; set; }
1011

11-
[JsonPropertyName("@timestamp")]
12+
[JsonProperty("@timestamp")]
1213
public string TimeStampISO8601 { get; set; }
1314

14-
[JsonPropertyName("@message")]
15+
[JsonProperty("@message")]
1516
public string Message { get; set; }
1617

17-
[JsonPropertyName("@fields")]
18+
[JsonProperty("@fields")]
1819
public IDictionary<string, object> Fields { get; set; }
1920

20-
[JsonPropertyName("@tags")]
21+
[JsonProperty("@tags")]
2122
public ICollection<string> Tags { get; set; }
2223

23-
[JsonPropertyName("@type")]
24+
[JsonProperty("@type")]
2425
public string Type { get; set; }
2526

26-
[JsonPropertyName("level")]
27+
[JsonProperty("level")]
2728
public string Level { get; set; }
2829
}
2930

@@ -71,4 +72,4 @@ public static void AddTag(this LogLine line, string tag)
7172
line.Tags.Add(tag);
7273
}
7374
}
74-
}
75+
}

0 commit comments

Comments
 (0)