Replies: 1 comment 1 reply
-
Looks a bit like a call to
Can you show the code you are using to log this and include the type information if you are just passing a JSON type to Serilog. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write JSON rendered from an object to the MSSqlServer sink. I'm also logging to the File sink and the JSON is written correctly there, so I'm at a loss.
Here is the JSON going in to my database column - note that the object type is pre-pended, and the field names are not in quotes as they should be:
AuditRecord { Id: 1494, secondId: 56789, entity: "dbo.TableName", action: "Update", fields: [Field { field: "startDate", oldValue: "2018-01-01", newValue: "2018-01-02" }, Field { field: "reg", oldValue: "abc123", newValue: "def345" }], user: "userguid", timestamp: 05/04/2023 17:52:28, reason: "reasoncode" }
I don't understand how this format is being rendered. The same object is rendered as this by the File sink:
{"Id":1494,"secondId":56789,"entity":"dbo.Vehicle","action":"Update","fields":[{"field":"startDate","oldValue":"2018-01-01","newValue":"2018-01-02","$type":"Field"},{"field":"reg","oldValue":"abc123","newValue":"def345","$type":"Field"}],"user":"userguid","timestamp":"2023-05-04T17:52:28.1177133+01:00","reason":"reasoncode","$type":"AuditRecord"}
Why would the database sink be doing this, or where in the pipeline might this be happening?
Beta Was this translation helpful? Give feedback.
All reactions