-
I wan to use the JSON LogEvent instead of the XML Properties. I'm wondering if there is a way to convert existing data in the XML Properties column to the JSON LogEvent. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If I understand this correct, you want existing data persisted in a table to be converted to JSON. The sink cannot do such a thing since it only writes data to the SQL database but never reads any. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid you cannot do conversion directly with the sink. What you can do though are custom formatters. Have a look at the formatters feature described in the Serilog main repo documentation and also on our sample CustomLogEventFormatterDemo (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/tree/dev/sample/CustomLogEventFormatterDemo). |
Beta Was this translation helpful? Give feedback.
I'm afraid you cannot do conversion directly with the sink. What you can do though are custom formatters. Have a look at the formatters feature described in the Serilog main repo documentation and also on our sample CustomLogEventFormatterDemo (https://github.com/serilog-mssql/serilog-sinks-mssqlserver/tree/dev/sample/CustomLogEventFormatterDemo).